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
6f079f7e
Commit
6f079f7e
authored
9 years ago
by
Tim Emiola
Browse files
Options
Downloads
Plain Diff
Merge pull request #1592 from murgatroid99/node_auth_fix
Fixed client auth implementation and tests
parents
eb228c87
2c5fa16f
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/node/interop/interop_client.js
+1
-1
1 addition, 1 deletion
src/node/interop/interop_client.js
src/node/src/client.js
+7
-6
7 additions, 6 deletions
src/node/src/client.js
with
8 additions
and
7 deletions
src/node/interop/interop_client.js
+
1
−
1
View file @
6f079f7e
...
...
@@ -271,7 +271,7 @@ function cancelAfterFirstResponse(client, done) {
* @param {function} done Callback to call when the test is completed. Included
* primarily for use with mocha
*/
function
authTest
(
expected_user
,
client
,
scope
,
done
)
{
function
authTest
(
expected_user
,
scope
,
client
,
done
)
{
(
new
GoogleAuth
()).
getApplicationDefault
(
function
(
err
,
credential
)
{
assert
.
ifError
(
err
);
if
(
credential
.
createScopedRequired
()
&&
scope
)
{
...
...
This diff is collapsed.
Click to expand it.
src/node/src/client.js
+
7
−
6
View file @
6f079f7e
...
...
@@ -223,7 +223,7 @@ function makeUnaryRequestFunction(method, serialize, deserialize) {
emitter
.
cancel
=
function
cancel
()
{
call
.
cancel
();
};
this
.
updateMetadata
(
metadata
,
function
(
error
,
metadata
)
{
this
.
updateMetadata
(
this
.
auth_uri
,
metadata
,
function
(
error
,
metadata
)
{
if
(
error
)
{
call
.
cancel
();
callback
(
error
);
...
...
@@ -289,7 +289,7 @@ function makeClientStreamRequestFunction(method, serialize, deserialize) {
metadata
=
{};
}
var
stream
=
new
ClientWritableStream
(
call
,
serialize
);
this
.
updateMetadata
(
metadata
,
function
(
error
,
metadata
)
{
this
.
updateMetadata
(
this
.
auth_uri
,
metadata
,
function
(
error
,
metadata
)
{
if
(
error
)
{
call
.
cancel
();
callback
(
error
);
...
...
@@ -360,7 +360,7 @@ function makeServerStreamRequestFunction(method, serialize, deserialize) {
metadata
=
{};
}
var
stream
=
new
ClientReadableStream
(
call
,
deserialize
);
this
.
updateMetadata
(
metadata
,
function
(
error
,
metadata
)
{
this
.
updateMetadata
(
this
.
auth_uri
,
metadata
,
function
(
error
,
metadata
)
{
if
(
error
)
{
call
.
cancel
();
stream
.
emit
(
'
error
'
,
error
);
...
...
@@ -427,7 +427,7 @@ function makeBidiStreamRequestFunction(method, serialize, deserialize) {
metadata
=
{};
}
var
stream
=
new
ClientDuplexStream
(
call
,
serialize
,
deserialize
);
this
.
updateMetadata
(
metadata
,
function
(
error
,
metadata
)
{
this
.
updateMetadata
(
this
.
auth_uri
,
metadata
,
function
(
error
,
metadata
)
{
if
(
error
)
{
call
.
cancel
();
stream
.
emit
(
'
error
'
,
error
);
...
...
@@ -503,10 +503,11 @@ function makeClientConstructor(methods, serviceName) {
callback
(
null
,
metadata
);
};
}
this
.
server_address
=
address
.
replace
(
/
\/
$/
,
''
);
this
.
channel
=
new
grpc
.
Channel
(
address
,
options
);
this
.
updateMetadata
=
_
.
partial
(
updateMetadata
,
this
.
server_address
+
'
/
'
+
serviceName
)
;
this
.
auth_uri
=
this
.
server_address
+
'
/
'
+
serviceName
;
this
.
updateMetadata
=
updateMetadata
;
}
_
.
each
(
methods
,
function
(
attrs
,
name
)
{
...
...
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