Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
9490daf6
Commit
9490daf6
authored
8 years ago
by
Jan Tattermusch
Browse files
Options
Downloads
Patches
Plain Diff
remove Google.Apis.Auth related CoreCLR todos
parent
a6624bb0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/csharp/Grpc.IntegrationTesting/InteropClient.cs
+0
-25
0 additions, 25 deletions
src/csharp/Grpc.IntegrationTesting/InteropClient.cs
with
0 additions
and
25 deletions
src/csharp/Grpc.IntegrationTesting/InteropClient.cs
+
0
−
25
View file @
9490daf6
...
@@ -145,26 +145,16 @@ namespace Grpc.IntegrationTesting
...
@@ -145,26 +145,16 @@ namespace Grpc.IntegrationTesting
if
(
options
.
TestCase
==
"jwt_token_creds"
)
if
(
options
.
TestCase
==
"jwt_token_creds"
)
{
{
#if !NETCOREAPP1_0
var
googleCredential
=
await
GoogleCredential
.
GetApplicationDefaultAsync
();
var
googleCredential
=
await
GoogleCredential
.
GetApplicationDefaultAsync
();
Assert
.
IsTrue
(
googleCredential
.
IsCreateScopedRequired
);
Assert
.
IsTrue
(
googleCredential
.
IsCreateScopedRequired
);
credentials
=
ChannelCredentials
.
Create
(
credentials
,
googleCredential
.
ToCallCredentials
());
credentials
=
ChannelCredentials
.
Create
(
credentials
,
googleCredential
.
ToCallCredentials
());
#else
// TODO(jtattermusch): implement this
throw
new
NotImplementedException
(
"Not supported on CoreCLR yet"
);
#endif
}
}
if
(
options
.
TestCase
==
"compute_engine_creds"
)
if
(
options
.
TestCase
==
"compute_engine_creds"
)
{
{
#if !NETCOREAPP1_0
var
googleCredential
=
await
GoogleCredential
.
GetApplicationDefaultAsync
();
var
googleCredential
=
await
GoogleCredential
.
GetApplicationDefaultAsync
();
Assert
.
IsFalse
(
googleCredential
.
IsCreateScopedRequired
);
Assert
.
IsFalse
(
googleCredential
.
IsCreateScopedRequired
);
credentials
=
ChannelCredentials
.
Create
(
credentials
,
googleCredential
.
ToCallCredentials
());
credentials
=
ChannelCredentials
.
Create
(
credentials
,
googleCredential
.
ToCallCredentials
());
#else
// TODO(jtattermusch): implement this
throw
new
NotImplementedException
(
"Not supported on CoreCLR yet"
);
#endif
}
}
return
credentials
;
return
credentials
;
}
}
...
@@ -395,7 +385,6 @@ namespace Grpc.IntegrationTesting
...
@@ -395,7 +385,6 @@ namespace Grpc.IntegrationTesting
public
static
async
Task
RunOAuth2AuthTokenAsync
(
TestService
.
TestServiceClient
client
,
string
oauthScope
)
public
static
async
Task
RunOAuth2AuthTokenAsync
(
TestService
.
TestServiceClient
client
,
string
oauthScope
)
{
{
#if !NETCOREAPP1_0
Console
.
WriteLine
(
"running oauth2_auth_token"
);
Console
.
WriteLine
(
"running oauth2_auth_token"
);
ITokenAccess
credential
=
(
await
GoogleCredential
.
GetApplicationDefaultAsync
()).
CreateScoped
(
new
[]
{
oauthScope
});
ITokenAccess
credential
=
(
await
GoogleCredential
.
GetApplicationDefaultAsync
()).
CreateScoped
(
new
[]
{
oauthScope
});
string
oauth2Token
=
await
credential
.
GetAccessTokenForRequestAsync
();
string
oauth2Token
=
await
credential
.
GetAccessTokenForRequestAsync
();
...
@@ -413,15 +402,10 @@ namespace Grpc.IntegrationTesting
...
@@ -413,15 +402,10 @@ namespace Grpc.IntegrationTesting
Assert
.
True
(
oauthScope
.
Contains
(
response
.
OauthScope
));
Assert
.
True
(
oauthScope
.
Contains
(
response
.
OauthScope
));
Assert
.
AreEqual
(
GetEmailFromServiceAccountFile
(),
response
.
Username
);
Assert
.
AreEqual
(
GetEmailFromServiceAccountFile
(),
response
.
Username
);
Console
.
WriteLine
(
"Passed!"
);
Console
.
WriteLine
(
"Passed!"
);
#else
// TODO(jtattermusch): implement this
throw
new
NotImplementedException
(
"Not supported on CoreCLR yet"
);
#endif
}
}
public
static
async
Task
RunPerRpcCredsAsync
(
TestService
.
TestServiceClient
client
,
string
oauthScope
)
public
static
async
Task
RunPerRpcCredsAsync
(
TestService
.
TestServiceClient
client
,
string
oauthScope
)
{
{
#if !NETCOREAPP1_0
Console
.
WriteLine
(
"running per_rpc_creds"
);
Console
.
WriteLine
(
"running per_rpc_creds"
);
ITokenAccess
googleCredential
=
await
GoogleCredential
.
GetApplicationDefaultAsync
();
ITokenAccess
googleCredential
=
await
GoogleCredential
.
GetApplicationDefaultAsync
();
...
@@ -435,10 +419,6 @@ namespace Grpc.IntegrationTesting
...
@@ -435,10 +419,6 @@ namespace Grpc.IntegrationTesting
Assert
.
AreEqual
(
GetEmailFromServiceAccountFile
(),
response
.
Username
);
Assert
.
AreEqual
(
GetEmailFromServiceAccountFile
(),
response
.
Username
);
Console
.
WriteLine
(
"Passed!"
);
Console
.
WriteLine
(
"Passed!"
);
#else
// TODO(jtattermusch): implement this
throw
new
NotImplementedException
(
"Not supported on CoreCLR yet"
);
#endif
}
}
public
static
async
Task
RunCancelAfterBeginAsync
(
TestService
.
TestServiceClient
client
)
public
static
async
Task
RunCancelAfterBeginAsync
(
TestService
.
TestServiceClient
client
)
...
@@ -731,17 +711,12 @@ namespace Grpc.IntegrationTesting
...
@@ -731,17 +711,12 @@ namespace Grpc.IntegrationTesting
// extracts the client_email field from service account file used for auth test cases
// extracts the client_email field from service account file used for auth test cases
private
static
string
GetEmailFromServiceAccountFile
()
private
static
string
GetEmailFromServiceAccountFile
()
{
{
#if !NETCOREAPP1_0
string
keyFile
=
Environment
.
GetEnvironmentVariable
(
"GOOGLE_APPLICATION_CREDENTIALS"
);
string
keyFile
=
Environment
.
GetEnvironmentVariable
(
"GOOGLE_APPLICATION_CREDENTIALS"
);
Assert
.
IsNotNull
(
keyFile
);
Assert
.
IsNotNull
(
keyFile
);
var
jobject
=
JObject
.
Parse
(
File
.
ReadAllText
(
keyFile
));
var
jobject
=
JObject
.
Parse
(
File
.
ReadAllText
(
keyFile
));
string
email
=
jobject
.
GetValue
(
"client_email"
).
Value
<
string
>();
string
email
=
jobject
.
GetValue
(
"client_email"
).
Value
<
string
>();
Assert
.
IsTrue
(
email
.
Length
>
0
);
// spec requires nonempty client email.
Assert
.
IsTrue
(
email
.
Length
>
0
);
// spec requires nonempty client email.
return
email
;
return
email
;
#else
// TODO(jtattermusch): implement this
throw
new
NotImplementedException
(
"Not supported on CoreCLR yet"
);
#endif
}
}
private
static
Metadata
CreateTestMetadata
()
private
static
Metadata
CreateTestMetadata
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment