Skip to content

Commit 47901b6

Browse files
feat: Streamline Downscope sample (GoogleCloudPlatform#2560)
1 parent 7c6e9d9 commit 47901b6

1 file changed

Lines changed: 1 addition & 18 deletions

File tree

auth/downscoping.js

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -115,24 +115,7 @@ const downscopingWithCredentialAccessBoundary = async ({
115115

116116
const storageOptions = {
117117
projectId: process.env.GOOGLE_CLOUD_PROJECT,
118-
authClient: {
119-
sign: () => {
120-
Promise.reject('unsupported');
121-
},
122-
getCredentials: async () => {
123-
Promise.reject();
124-
},
125-
request: opts => {
126-
return oauth2Client.request(opts);
127-
},
128-
authorizeRequest: async opts => {
129-
opts = opts || {};
130-
const url = opts.url || opts.uri;
131-
const headers = await oauth2Client.getRequestHeaders(url);
132-
opts.headers = Object.assign(opts.headers || {}, headers);
133-
return opts;
134-
},
135-
},
118+
authClient: oauth2Client,
136119
};
137120

138121
const storage = new Storage(storageOptions);

0 commit comments

Comments
 (0)