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
9f254c0c
Commit
9f254c0c
authored
8 years ago
by
Jan Tattermusch
Browse files
Options
Downloads
Patches
Plain Diff
get rid of compiler warnings
parent
d0e7c6d0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/csharp/Grpc.Auth/GoogleAuthInterceptors.cs
+3
-1
3 additions, 1 deletion
src/csharp/Grpc.Auth/GoogleAuthInterceptors.cs
src/csharp/Grpc.Core/Internal/NativeMetadataCredentialsPlugin.cs
+5
-2
5 additions, 2 deletions
...arp/Grpc.Core/Internal/NativeMetadataCredentialsPlugin.cs
with
8 additions
and
3 deletions
src/csharp/Grpc.Auth/GoogleAuthInterceptors.cs
+
3
−
1
View file @
9f254c0c
...
...
@@ -33,6 +33,7 @@
using
System
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
Google.Apis.Auth.OAuth2
;
using
Grpc.Core
;
...
...
@@ -72,9 +73,10 @@ namespace Grpc.Auth
public
static
AsyncAuthInterceptor
FromAccessToken
(
string
accessToken
)
{
GrpcPreconditions
.
CheckNotNull
(
accessToken
);
return
new
AsyncAuthInterceptor
(
async
(
context
,
metadata
)
=>
return
new
AsyncAuthInterceptor
((
context
,
metadata
)
=>
{
metadata
.
Add
(
CreateBearerTokenHeader
(
accessToken
));
return
Task
.
FromResult
<
object
>(
null
);
});
}
...
...
This diff is collapsed.
Click to expand it.
src/csharp/Grpc.Core/Internal/NativeMetadataCredentialsPlugin.cs
+
5
−
2
View file @
9f254c0c
...
...
@@ -78,7 +78,10 @@ namespace Grpc.Core.Internal
{
var
context
=
new
AuthInterceptorContext
(
Marshal
.
PtrToStringAnsi
(
serviceUrlPtr
),
Marshal
.
PtrToStringAnsi
(
methodNamePtr
));
StartGetMetadata
(
context
,
callbackPtr
,
userDataPtr
);
// Don't await, we are in a native callback and need to return.
#
pragma
warning
disable
4014
GetMetadataAsync
(
context
,
callbackPtr
,
userDataPtr
);
#
pragma
warning
restore
4014
}
catch
(
Exception
e
)
{
...
...
@@ -87,7 +90,7 @@ namespace Grpc.Core.Internal
}
}
private
async
Task
Start
GetMetadata
(
AuthInterceptorContext
context
,
IntPtr
callbackPtr
,
IntPtr
userDataPtr
)
private
async
Task
GetMetadata
Async
(
AuthInterceptorContext
context
,
IntPtr
callbackPtr
,
IntPtr
userDataPtr
)
{
try
{
...
...
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