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
e24dde57
Commit
e24dde57
authored
9 years ago
by
Nicolas "Pixel" Noble
Browse files
Options
Downloads
Patches
Plain Diff
Adressing comments.
parent
23be2803
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++/time.h
+3
-3
3 additions, 3 deletions
include/grpc++/time.h
src/cpp/client/secure_credentials.cc
+6
-6
6 additions, 6 deletions
src/cpp/client/secure_credentials.cc
with
9 additions
and
9 deletions
include/grpc++/time.h
+
3
−
3
View file @
e24dde57
...
...
@@ -40,13 +40,13 @@ 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 th
at
comment as your compiler will have
fired an error below. In order to fix th
at
issue, you have two potential
will most likely be looking at th
is
comment as your compiler will have
fired an error below. In order to fix th
is
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 th
at
.
want to use here. See below for two examples of how to do th
is
.
*/
template
<
typename
T
>
...
...
This diff is collapsed.
Click to expand it.
src/cpp/client/secure_credentials.cc
+
6
−
6
View file @
e24dde57
...
...
@@ -81,27 +81,27 @@ std::unique_ptr<Credentials> ComputeEngineCredentials() {
// Builds service account credentials.
std
::
unique_ptr
<
Credentials
>
ServiceAccountCredentials
(
const
grpc
::
string
&
json_key
,
const
grpc
::
string
&
scope
,
long
token_lifetime
)
{
if
(
token_lifetime
<=
0
)
{
long
token_lifetime
_seconds
)
{
if
(
token_lifetime
_seconds
<=
0
)
{
gpr_log
(
GPR_ERROR
,
"Trying to create ServiceAccountCredentials "
"with non-positive lifetime"
);
return
WrapCredentials
(
nullptr
);
}
gpr_timespec
lifetime
=
gpr_time_from_seconds
(
token_lifetime
);
gpr_timespec
lifetime
=
gpr_time_from_seconds
(
token_lifetime
_seconds
);
return
WrapCredentials
(
grpc_service_account_credentials_create
(
json_key
.
c_str
(),
scope
.
c_str
(),
lifetime
));
}
// Builds JWT credentials.
std
::
unique_ptr
<
Credentials
>
JWTCredentials
(
const
grpc
::
string
&
json_key
,
long
token_lifetime
)
{
if
(
token_lifetime
<=
0
)
{
const
grpc
::
string
&
json_key
,
long
token_lifetime
_seconds
)
{
if
(
token_lifetime
_seconds
<=
0
)
{
gpr_log
(
GPR_ERROR
,
"Trying to create JWTCredentials with non-positive lifetime"
);
return
WrapCredentials
(
nullptr
);
}
gpr_timespec
lifetime
=
gpr_time_from_seconds
(
token_lifetime
);
gpr_timespec
lifetime
=
gpr_time_from_seconds
(
token_lifetime
_seconds
);
return
WrapCredentials
(
grpc_jwt_credentials_create
(
json_key
.
c_str
(),
lifetime
));
}
...
...
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