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
b7bbffe9
Commit
b7bbffe9
authored
10 years ago
by
Nicolas "Pixel" Noble
Browse files
Options
Downloads
Patches
Plain Diff
Addressing github comments.
parent
a05b8b7b
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
include/grpc++/credentials.h
+8
-8
8 additions, 8 deletions
include/grpc++/credentials.h
include/grpc++/time.h
+24
-2
24 additions, 2 deletions
include/grpc++/time.h
with
32 additions
and
10 deletions
include/grpc++/credentials.h
+
8
−
8
View file @
b7bbffe9
...
@@ -97,20 +97,20 @@ std::unique_ptr<Credentials> ComputeEngineCredentials();
...
@@ -97,20 +97,20 @@ std::unique_ptr<Credentials> ComputeEngineCredentials();
// Builds service account credentials.
// Builds service account credentials.
// json_key is the JSON key string containing the client's private key.
// json_key is the JSON key string containing the client's private key.
// scope is a space-delimited list of the requested permissions.
// scope is a space-delimited list of the requested permissions.
// token_lifetime is the lifetime of each token acquired
through this service
// token_lifetime
_seconds
is the lifetime
in seconds
of each token acquired
// account credentials. It should be positive and should
not exceed
//
through this service
account credentials. It should be positive and should
// grpc_max_auth_token_lifetime or will be cropped to this value.
//
not exceed
grpc_max_auth_token_lifetime or will be cropped to this value.
std
::
unique_ptr
<
Credentials
>
ServiceAccountCredentials
(
std
::
unique_ptr
<
Credentials
>
ServiceAccountCredentials
(
const
grpc
::
string
&
json_key
,
const
grpc
::
string
&
scope
,
const
grpc
::
string
&
json_key
,
const
grpc
::
string
&
scope
,
long
token_lifetime
);
long
token_lifetime
_seconds
);
// Builds JWT credentials.
// Builds JWT credentials.
// json_key is the JSON key string containing the client's private key.
// json_key is the JSON key string containing the client's private key.
// token_lifetime is the lifetime of each Json Web Token
(JWT) created with
// token_lifetime
_seconds
is the lifetime
in seconds
of each Json Web Token
// this credentials.
It should not exceed
grpc_max_auth_token_lifetime or
//
(JWT) created with
this credentials. It should not exceed
// will be cropped to this value.
//
grpc_max_auth_token_lifetime or
will be cropped to this value.
std
::
unique_ptr
<
Credentials
>
JWTCredentials
(
std
::
unique_ptr
<
Credentials
>
JWTCredentials
(
const
grpc
::
string
&
json_key
,
long
token_lifetime
);
const
grpc
::
string
&
json_key
,
long
token_lifetime
_seconds
);
// Builds refresh token credentials.
// Builds refresh token credentials.
// json_refresh_token is the JSON string containing the refresh token along
// json_refresh_token is the JSON string containing the refresh token along
...
...
This diff is collapsed.
Click to expand it.
include/grpc++/time.h
+
24
−
2
View file @
b7bbffe9
...
@@ -38,11 +38,33 @@
...
@@ -38,11 +38,33 @@
namespace
grpc
{
namespace
grpc
{
/* If you are trying to use CompletionQueue::AsyncNext with a time class that
isn't either gpr_timespec or std::chrono::system_clock::time_point, you
will most likely be looking at that comment as your compiler will have
fired the static_assert below. In order to fix that issue, you have two
potential solutions:
1. Use gpr_timespec or std::chrono::system_clock::time_point instead
2. Specialize the TimePoint class with whichever time class that you
want to use here. See below for two examples of how to do that.
*/
template
<
typename
T
>
template
<
typename
T
>
class
TimePoint
{
class
TimePoint
{
public:
public:
TimePoint
(
const
T
&
time
)
:
time_
(
time
)
{
}
TimePoint
(
const
T
&
time
)
{
gpr_timespec
raw_time
()
const
{
return
time_
;
}
static_assert
(
false
,
"You need a specialization of TimePoint"
);
}
gpr_timespec
raw_time
()
{
static_assert
(
false
,
"You need a specialization of TimePoint"
);
}
};
template
<
>
class
TimePoint
<
gpr_timespec
>
{
public:
TimePoint
(
const
gpr_timespec
&
time
)
:
time_
(
time
)
{
}
gpr_timespec
raw_time
()
{
return
time_
;
}
private
:
private
:
gpr_timespec
time_
;
gpr_timespec
time_
;
};
};
...
...
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