@taskcluster/client-web 88.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +373 -0
- package/package.json +43 -0
- package/src/Client.js +385 -0
- package/src/clients/Auth.js +466 -0
- package/src/clients/AuthEvents.js +62 -0
- package/src/clients/Github.js +150 -0
- package/src/clients/GithubEvents.js +68 -0
- package/src/clients/Hooks.js +181 -0
- package/src/clients/HooksEvents.js +38 -0
- package/src/clients/Index.js +152 -0
- package/src/clients/Notify.js +144 -0
- package/src/clients/NotifyEvents.js +27 -0
- package/src/clients/Object.js +135 -0
- package/src/clients/PurgeCache.js +92 -0
- package/src/clients/Queue.js +734 -0
- package/src/clients/QueueEvents.js +129 -0
- package/src/clients/Secrets.js +103 -0
- package/src/clients/WorkerManager.js +303 -0
- package/src/clients/WorkerManagerEvents.js +112 -0
- package/src/credentials.js +210 -0
- package/src/emitter.js +58 -0
- package/src/fetch.js +93 -0
- package/src/index.js +26 -0
- package/src/utils.js +123 -0
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
|
+
|
|
3
|
+
import Client from '../Client';
|
|
4
|
+
|
|
5
|
+
export default class Auth extends Client {
|
|
6
|
+
constructor(options = {}) {
|
|
7
|
+
super({
|
|
8
|
+
serviceName: 'auth',
|
|
9
|
+
serviceVersion: 'v1',
|
|
10
|
+
exchangePrefix: '',
|
|
11
|
+
...options,
|
|
12
|
+
});
|
|
13
|
+
this.ping.entry = {"args":[],"category":"Monitoring","method":"get","name":"ping","query":[],"route":"/ping","stability":"stable","type":"function"}; // eslint-disable-line
|
|
14
|
+
this.lbheartbeat.entry = {"args":[],"category":"Monitoring","method":"get","name":"lbheartbeat","query":[],"route":"/__lbheartbeat__","stability":"stable","type":"function"}; // eslint-disable-line
|
|
15
|
+
this.version.entry = {"args":[],"category":"Monitoring","method":"get","name":"version","query":[],"route":"/__version__","stability":"stable","type":"function"}; // eslint-disable-line
|
|
16
|
+
this.listClients.entry = {"args":[],"category":"Clients","method":"get","name":"listClients","output":true,"query":["prefix","continuationToken","limit"],"route":"/clients/","scopes":"auth:list-clients","stability":"stable","type":"function"}; // eslint-disable-line
|
|
17
|
+
this.client.entry = {"args":["clientId"],"category":"Clients","method":"get","name":"client","output":true,"query":[],"route":"/clients/<clientId>","scopes":"auth:get-client:<clientId>","stability":"stable","type":"function"}; // eslint-disable-line
|
|
18
|
+
this.createClient.entry = {"args":["clientId"],"category":"Clients","input":true,"method":"put","name":"createClient","output":true,"query":[],"route":"/clients/<clientId>","scopes":{"AllOf":["auth:create-client:<clientId>",{"each":"<scope>","for":"scope","in":"scopes"}]},"stability":"stable","type":"function"}; // eslint-disable-line
|
|
19
|
+
this.getEntityHistory.entry = {"args":["entityType","entityId"],"category":"Audit","method":"get","name":"getEntityHistory","output":true,"query":["continuationToken","limit"],"route":"/audit/<entityType>/<entityId>","scopes":"auth:audit-history:<entityType>","stability":"stable","type":"function"}; // eslint-disable-line
|
|
20
|
+
this.listAuditHistory.entry = {"args":["clientId"],"category":"Audit","method":"get","name":"listAuditHistory","output":true,"query":["continuationToken","limit"],"route":"/clients/<clientId>/audit","scopes":"auth:client-audit-history:<clientId>","stability":"stable","type":"function"}; // eslint-disable-line
|
|
21
|
+
this.resetAccessToken.entry = {"args":["clientId"],"category":"Clients","method":"post","name":"resetAccessToken","output":true,"query":[],"route":"/clients/<clientId>/reset","scopes":"auth:reset-access-token:<clientId>","stability":"stable","type":"function"}; // eslint-disable-line
|
|
22
|
+
this.updateClient.entry = {"args":["clientId"],"category":"Clients","input":true,"method":"post","name":"updateClient","output":true,"query":[],"route":"/clients/<clientId>","scopes":{"AllOf":["auth:update-client:<clientId>",{"each":"<scope>","for":"scope","in":"scopesAdded"}]},"stability":"stable","type":"function"}; // eslint-disable-line
|
|
23
|
+
this.enableClient.entry = {"args":["clientId"],"category":"Clients","method":"post","name":"enableClient","output":true,"query":[],"route":"/clients/<clientId>/enable","scopes":"auth:enable-client:<clientId>","stability":"stable","type":"function"}; // eslint-disable-line
|
|
24
|
+
this.disableClient.entry = {"args":["clientId"],"category":"Clients","method":"post","name":"disableClient","output":true,"query":[],"route":"/clients/<clientId>/disable","scopes":"auth:disable-client:<clientId>","stability":"stable","type":"function"}; // eslint-disable-line
|
|
25
|
+
this.deleteClient.entry = {"args":["clientId"],"category":"Clients","method":"delete","name":"deleteClient","query":[],"route":"/clients/<clientId>","scopes":"auth:delete-client:<clientId>","stability":"stable","type":"function"}; // eslint-disable-line
|
|
26
|
+
this.listRoles.entry = {"args":[],"category":"Roles","method":"get","name":"listRoles","output":true,"query":[],"route":"/roles/","scopes":"auth:list-roles","stability":"stable","type":"function"}; // eslint-disable-line
|
|
27
|
+
this.listRoles2.entry = {"args":[],"category":"Roles","method":"get","name":"listRoles2","output":true,"query":["continuationToken","limit"],"route":"/roles2/","scopes":"auth:list-roles","stability":"stable","type":"function"}; // eslint-disable-line
|
|
28
|
+
this.listRoleIds.entry = {"args":[],"category":"Roles","method":"get","name":"listRoleIds","output":true,"query":["continuationToken","limit"],"route":"/roleids/","scopes":"auth:list-roles","stability":"stable","type":"function"}; // eslint-disable-line
|
|
29
|
+
this.role.entry = {"args":["roleId"],"category":"Roles","method":"get","name":"role","output":true,"query":[],"route":"/roles/<roleId>","scopes":"auth:get-role:<roleId>","stability":"stable","type":"function"}; // eslint-disable-line
|
|
30
|
+
this.createRole.entry = {"args":["roleId"],"category":"Roles","input":true,"method":"put","name":"createRole","output":true,"query":[],"route":"/roles/<roleId>","scopes":{"AllOf":["auth:create-role:<roleId>",{"each":"<scope>","for":"scope","in":"scopes"}]},"stability":"stable","type":"function"}; // eslint-disable-line
|
|
31
|
+
this.updateRole.entry = {"args":["roleId"],"category":"Roles","input":true,"method":"post","name":"updateRole","output":true,"query":[],"route":"/roles/<roleId>","scopes":{"AllOf":["auth:update-role:<roleId>",{"each":"<scope>","for":"scope","in":"scopesAdded"}]},"stability":"stable","type":"function"}; // eslint-disable-line
|
|
32
|
+
this.deleteRole.entry = {"args":["roleId"],"category":"Roles","method":"delete","name":"deleteRole","query":[],"route":"/roles/<roleId>","scopes":"auth:delete-role:<roleId>","stability":"stable","type":"function"}; // eslint-disable-line
|
|
33
|
+
this.expandScopes.entry = {"args":[],"category":"Scopes and Auth","input":true,"method":"post","name":"expandScopes","output":true,"query":[],"route":"/scopes/expand","scopes":"auth:expand-scopes","stability":"stable","type":"function"}; // eslint-disable-line
|
|
34
|
+
this.currentScopes.entry = {"args":[],"category":"Scopes and Auth","method":"get","name":"currentScopes","output":true,"query":[],"route":"/scopes/current","scopes":"auth:current-scopes","stability":"stable","type":"function"}; // eslint-disable-line
|
|
35
|
+
this.awsS3Credentials.entry = {"args":["level","bucket","prefix"],"category":"AWS Credentials","method":"get","name":"awsS3Credentials","output":true,"query":["format"],"route":"/aws/s3/<level>/<bucket>/<prefix>","scopes":{"else":"auth:aws-s3:read-write:<bucket>/<prefix>","if":"levelIsReadOnly","then":{"AnyOf":["auth:aws-s3:read-only:<bucket>/<prefix>","auth:aws-s3:read-write:<bucket>/<prefix>"]}},"stability":"stable","type":"function"}; // eslint-disable-line
|
|
36
|
+
this.azureAccounts.entry = {"args":[],"category":"Azure Credentials","method":"get","name":"azureAccounts","output":true,"query":[],"route":"/azure/accounts","scopes":"auth:azure-table:list-accounts","stability":"deprecated","type":"function"}; // eslint-disable-line
|
|
37
|
+
this.azureTables.entry = {"args":["account"],"category":"Azure Credentials","method":"get","name":"azureTables","output":true,"query":["continuationToken"],"route":"/azure/<account>/tables","scopes":"auth:azure-table:list-tables:<account>","stability":"deprecated","type":"function"}; // eslint-disable-line
|
|
38
|
+
this.azureTableSAS.entry = {"args":["account","table","level"],"category":"Azure Credentials","method":"get","name":"azureTableSAS","output":true,"query":[],"route":"/azure/<account>/table/<table>/<level>","scopes":{"else":"auth:azure-table:read-write:<account>/<table>","if":"levelIsReadOnly","then":{"AnyOf":["auth:azure-table:read-only:<account>/<table>","auth:azure-table:read-write:<account>/<table>"]}},"stability":"deprecated","type":"function"}; // eslint-disable-line
|
|
39
|
+
this.azureContainers.entry = {"args":["account"],"category":"Azure Credentials","method":"get","name":"azureContainers","output":true,"query":["continuationToken"],"route":"/azure/<account>/containers","scopes":"auth:azure-container:list-containers:<account>","stability":"deprecated","type":"function"}; // eslint-disable-line
|
|
40
|
+
this.azureContainerSAS.entry = {"args":["account","container","level"],"category":"Azure Credentials","method":"get","name":"azureContainerSAS","output":true,"query":[],"route":"/azure/<account>/containers/<container>/<level>","scopes":{"else":"auth:azure-container:read-write:<account>/<container>","if":"levelIsReadOnly","then":{"AnyOf":["auth:azure-container:read-only:<account>/<container>","auth:azure-container:read-write:<account>/<container>"]}},"stability":"deprecated","type":"function"}; // eslint-disable-line
|
|
41
|
+
this.sentryDSN.entry = {"args":["project"],"category":"Sentry Credentials","method":"get","name":"sentryDSN","output":true,"query":[],"route":"/sentry/<project>/dsn","scopes":"auth:sentry:<project>","stability":"stable","type":"function"}; // eslint-disable-line
|
|
42
|
+
this.websocktunnelToken.entry = {"args":["wstAudience","wstClient"],"category":"Websocktunnel Credentials","method":"get","name":"websocktunnelToken","output":true,"query":[],"route":"/websocktunnel/<wstAudience>/<wstClient>","scopes":"auth:websocktunnel-token:<wstAudience>/<wstClient>","stability":"stable","type":"function"}; // eslint-disable-line
|
|
43
|
+
this.gcpCredentials.entry = {"args":["projectId","serviceAccount"],"category":"GCP Credentials","method":"get","name":"gcpCredentials","output":true,"query":[],"route":"/gcp/credentials/<projectId>/<serviceAccount>","scopes":"auth:gcp:access-token:<projectId>/<serviceAccount>","stability":"stable","type":"function"}; // eslint-disable-line
|
|
44
|
+
this.authenticateHawk.entry = {"args":[],"category":"Scopes and Auth","input":true,"method":"post","name":"authenticateHawk","output":true,"query":[],"route":"/authenticate-hawk","stability":"stable","type":"function"}; // eslint-disable-line
|
|
45
|
+
this.testAuthenticate.entry = {"args":[],"category":"Scopes and Auth","input":true,"method":"post","name":"testAuthenticate","output":true,"query":[],"route":"/test-authenticate","stability":"stable","type":"function"}; // eslint-disable-line
|
|
46
|
+
this.testAuthenticateGet.entry = {"args":[],"category":"Scopes and Auth","method":"get","name":"testAuthenticateGet","output":true,"query":[],"route":"/test-authenticate-get/","stability":"stable","type":"function"}; // eslint-disable-line
|
|
47
|
+
this.heartbeat.entry = {"args":[],"category":"Monitoring","method":"get","name":"heartbeat","query":[],"route":"/__heartbeat__","stability":"stable","type":"function"}; // eslint-disable-line
|
|
48
|
+
}
|
|
49
|
+
/* eslint-disable max-len */
|
|
50
|
+
// Respond without doing anything.
|
|
51
|
+
// This endpoint is used to check that the service is up.
|
|
52
|
+
/* eslint-enable max-len */
|
|
53
|
+
ping(...args) {
|
|
54
|
+
this.validate(this.ping.entry, args);
|
|
55
|
+
|
|
56
|
+
return this.request(this.ping.entry, args);
|
|
57
|
+
}
|
|
58
|
+
/* eslint-disable max-len */
|
|
59
|
+
// Respond without doing anything.
|
|
60
|
+
// This endpoint is used to check that the service is up.
|
|
61
|
+
/* eslint-enable max-len */
|
|
62
|
+
lbheartbeat(...args) {
|
|
63
|
+
this.validate(this.lbheartbeat.entry, args);
|
|
64
|
+
|
|
65
|
+
return this.request(this.lbheartbeat.entry, args);
|
|
66
|
+
}
|
|
67
|
+
/* eslint-disable max-len */
|
|
68
|
+
// Respond with the JSON version object.
|
|
69
|
+
// https://github.com/mozilla-services/Dockerflow/blob/main/docs/version_object.md
|
|
70
|
+
/* eslint-enable max-len */
|
|
71
|
+
version(...args) {
|
|
72
|
+
this.validate(this.version.entry, args);
|
|
73
|
+
|
|
74
|
+
return this.request(this.version.entry, args);
|
|
75
|
+
}
|
|
76
|
+
/* eslint-disable max-len */
|
|
77
|
+
// Get a list of all clients. With `prefix`, only clients for which
|
|
78
|
+
// it is a prefix of the clientId are returned.
|
|
79
|
+
// By default this end-point will try to return up to 1000 clients in one
|
|
80
|
+
// request. But it **may return less, even none**.
|
|
81
|
+
// It may also return a `continuationToken` even though there are no more
|
|
82
|
+
// results. However, you can only be sure to have seen all results if you
|
|
83
|
+
// keep calling `listClients` with the last `continuationToken` until you
|
|
84
|
+
// get a result without a `continuationToken`.
|
|
85
|
+
/* eslint-enable max-len */
|
|
86
|
+
listClients(...args) {
|
|
87
|
+
this.validate(this.listClients.entry, args);
|
|
88
|
+
|
|
89
|
+
return this.request(this.listClients.entry, args);
|
|
90
|
+
}
|
|
91
|
+
/* eslint-disable max-len */
|
|
92
|
+
// Get information about a single client.
|
|
93
|
+
/* eslint-enable max-len */
|
|
94
|
+
client(...args) {
|
|
95
|
+
this.validate(this.client.entry, args);
|
|
96
|
+
|
|
97
|
+
return this.request(this.client.entry, args);
|
|
98
|
+
}
|
|
99
|
+
/* eslint-disable max-len */
|
|
100
|
+
// Create a new client and get the `accessToken` for this client.
|
|
101
|
+
// You should store the `accessToken` from this API call as there is no
|
|
102
|
+
// other way to retrieve it.
|
|
103
|
+
// If you lose the `accessToken` you can call `resetAccessToken` to reset
|
|
104
|
+
// it, and a new `accessToken` will be returned. You cannot retrieve the
|
|
105
|
+
// current `accessToken`.
|
|
106
|
+
// If a client with the same `clientId` already exists this operation will
|
|
107
|
+
// fail. Use `updateClient` if you wish to update an existing client.
|
|
108
|
+
// The caller's scopes must satisfy `scopes`.
|
|
109
|
+
/* eslint-enable max-len */
|
|
110
|
+
createClient(...args) {
|
|
111
|
+
this.validate(this.createClient.entry, args);
|
|
112
|
+
|
|
113
|
+
return this.request(this.createClient.entry, args);
|
|
114
|
+
}
|
|
115
|
+
/* eslint-disable max-len */
|
|
116
|
+
// Get entity history based on entity type and entity name
|
|
117
|
+
/* eslint-enable max-len */
|
|
118
|
+
getEntityHistory(...args) {
|
|
119
|
+
this.validate(this.getEntityHistory.entry, args);
|
|
120
|
+
|
|
121
|
+
return this.request(this.getEntityHistory.entry, args);
|
|
122
|
+
}
|
|
123
|
+
/* eslint-disable max-len */
|
|
124
|
+
// Get audit history of a client based on clientId.
|
|
125
|
+
/* eslint-enable max-len */
|
|
126
|
+
listAuditHistory(...args) {
|
|
127
|
+
this.validate(this.listAuditHistory.entry, args);
|
|
128
|
+
|
|
129
|
+
return this.request(this.listAuditHistory.entry, args);
|
|
130
|
+
}
|
|
131
|
+
/* eslint-disable max-len */
|
|
132
|
+
// Reset a clients `accessToken`, this will revoke the existing
|
|
133
|
+
// `accessToken`, generate a new `accessToken` and return it from this
|
|
134
|
+
// call.
|
|
135
|
+
// There is no way to retrieve an existing `accessToken`, so if you lose it
|
|
136
|
+
// you must reset the accessToken to acquire it again.
|
|
137
|
+
/* eslint-enable max-len */
|
|
138
|
+
resetAccessToken(...args) {
|
|
139
|
+
this.validate(this.resetAccessToken.entry, args);
|
|
140
|
+
|
|
141
|
+
return this.request(this.resetAccessToken.entry, args);
|
|
142
|
+
}
|
|
143
|
+
/* eslint-disable max-len */
|
|
144
|
+
// Update an exisiting client. The `clientId` and `accessToken` cannot be
|
|
145
|
+
// updated, but `scopes` can be modified. The caller's scopes must
|
|
146
|
+
// satisfy all scopes being added to the client in the update operation.
|
|
147
|
+
// If no scopes are given in the request, the client's scopes remain
|
|
148
|
+
// unchanged
|
|
149
|
+
/* eslint-enable max-len */
|
|
150
|
+
updateClient(...args) {
|
|
151
|
+
this.validate(this.updateClient.entry, args);
|
|
152
|
+
|
|
153
|
+
return this.request(this.updateClient.entry, args);
|
|
154
|
+
}
|
|
155
|
+
/* eslint-disable max-len */
|
|
156
|
+
// Enable a client that was disabled with `disableClient`. If the client
|
|
157
|
+
// is already enabled, this does nothing.
|
|
158
|
+
// This is typically used by identity providers to re-enable clients that
|
|
159
|
+
// had been disabled when the corresponding identity's scopes changed.
|
|
160
|
+
/* eslint-enable max-len */
|
|
161
|
+
enableClient(...args) {
|
|
162
|
+
this.validate(this.enableClient.entry, args);
|
|
163
|
+
|
|
164
|
+
return this.request(this.enableClient.entry, args);
|
|
165
|
+
}
|
|
166
|
+
/* eslint-disable max-len */
|
|
167
|
+
// Disable a client. If the client is already disabled, this does nothing.
|
|
168
|
+
// This is typically used by identity providers to disable clients when the
|
|
169
|
+
// corresponding identity's scopes no longer satisfy the client's scopes.
|
|
170
|
+
/* eslint-enable max-len */
|
|
171
|
+
disableClient(...args) {
|
|
172
|
+
this.validate(this.disableClient.entry, args);
|
|
173
|
+
|
|
174
|
+
return this.request(this.disableClient.entry, args);
|
|
175
|
+
}
|
|
176
|
+
/* eslint-disable max-len */
|
|
177
|
+
// Delete a client, please note that any roles related to this client must
|
|
178
|
+
// be deleted independently.
|
|
179
|
+
/* eslint-enable max-len */
|
|
180
|
+
deleteClient(...args) {
|
|
181
|
+
this.validate(this.deleteClient.entry, args);
|
|
182
|
+
|
|
183
|
+
return this.request(this.deleteClient.entry, args);
|
|
184
|
+
}
|
|
185
|
+
/* eslint-disable max-len */
|
|
186
|
+
// Get a list of all roles. Each role object also includes the list of
|
|
187
|
+
// scopes it expands to. This always returns all roles in a single HTTP
|
|
188
|
+
// request.
|
|
189
|
+
// To get paginated results, use `listRoles2`.
|
|
190
|
+
/* eslint-enable max-len */
|
|
191
|
+
listRoles(...args) {
|
|
192
|
+
this.validate(this.listRoles.entry, args);
|
|
193
|
+
|
|
194
|
+
return this.request(this.listRoles.entry, args);
|
|
195
|
+
}
|
|
196
|
+
/* eslint-disable max-len */
|
|
197
|
+
// Get a list of all roles. Each role object also includes the list of
|
|
198
|
+
// scopes it expands to. This is similar to `listRoles` but differs in the
|
|
199
|
+
// format of the response.
|
|
200
|
+
// If no limit is given, all roles are returned. Since this
|
|
201
|
+
// list may become long, callers can use the `limit` and `continuationToken`
|
|
202
|
+
// query arguments to page through the responses.
|
|
203
|
+
/* eslint-enable max-len */
|
|
204
|
+
listRoles2(...args) {
|
|
205
|
+
this.validate(this.listRoles2.entry, args);
|
|
206
|
+
|
|
207
|
+
return this.request(this.listRoles2.entry, args);
|
|
208
|
+
}
|
|
209
|
+
/* eslint-disable max-len */
|
|
210
|
+
// Get a list of all role IDs.
|
|
211
|
+
// If no limit is given, the roleIds of all roles are returned. Since this
|
|
212
|
+
// list may become long, callers can use the `limit` and `continuationToken`
|
|
213
|
+
// query arguments to page through the responses.
|
|
214
|
+
/* eslint-enable max-len */
|
|
215
|
+
listRoleIds(...args) {
|
|
216
|
+
this.validate(this.listRoleIds.entry, args);
|
|
217
|
+
|
|
218
|
+
return this.request(this.listRoleIds.entry, args);
|
|
219
|
+
}
|
|
220
|
+
/* eslint-disable max-len */
|
|
221
|
+
// Get information about a single role, including the set of scopes that the
|
|
222
|
+
// role expands to.
|
|
223
|
+
/* eslint-enable max-len */
|
|
224
|
+
role(...args) {
|
|
225
|
+
this.validate(this.role.entry, args);
|
|
226
|
+
|
|
227
|
+
return this.request(this.role.entry, args);
|
|
228
|
+
}
|
|
229
|
+
/* eslint-disable max-len */
|
|
230
|
+
// Create a new role.
|
|
231
|
+
// The caller's scopes must satisfy the new role's scopes.
|
|
232
|
+
// If there already exists a role with the same `roleId` this operation
|
|
233
|
+
// will fail. Use `updateRole` to modify an existing role.
|
|
234
|
+
// Creation of a role that will generate an infinite expansion will result
|
|
235
|
+
// in an error response.
|
|
236
|
+
/* eslint-enable max-len */
|
|
237
|
+
createRole(...args) {
|
|
238
|
+
this.validate(this.createRole.entry, args);
|
|
239
|
+
|
|
240
|
+
return this.request(this.createRole.entry, args);
|
|
241
|
+
}
|
|
242
|
+
/* eslint-disable max-len */
|
|
243
|
+
// Update an existing role.
|
|
244
|
+
// The caller's scopes must satisfy all of the new scopes being added, but
|
|
245
|
+
// need not satisfy all of the role's existing scopes.
|
|
246
|
+
// An update of a role that will generate an infinite expansion will result
|
|
247
|
+
// in an error response.
|
|
248
|
+
/* eslint-enable max-len */
|
|
249
|
+
updateRole(...args) {
|
|
250
|
+
this.validate(this.updateRole.entry, args);
|
|
251
|
+
|
|
252
|
+
return this.request(this.updateRole.entry, args);
|
|
253
|
+
}
|
|
254
|
+
/* eslint-disable max-len */
|
|
255
|
+
// Delete a role. This operation will succeed regardless of whether or not
|
|
256
|
+
// the role exists.
|
|
257
|
+
/* eslint-enable max-len */
|
|
258
|
+
deleteRole(...args) {
|
|
259
|
+
this.validate(this.deleteRole.entry, args);
|
|
260
|
+
|
|
261
|
+
return this.request(this.deleteRole.entry, args);
|
|
262
|
+
}
|
|
263
|
+
/* eslint-disable max-len */
|
|
264
|
+
// Return an expanded copy of the given scopeset, with scopes implied by any
|
|
265
|
+
// roles included.
|
|
266
|
+
/* eslint-enable max-len */
|
|
267
|
+
expandScopes(...args) {
|
|
268
|
+
this.validate(this.expandScopes.entry, args);
|
|
269
|
+
|
|
270
|
+
return this.request(this.expandScopes.entry, args);
|
|
271
|
+
}
|
|
272
|
+
/* eslint-disable max-len */
|
|
273
|
+
// Return the expanded scopes available in the request, taking into account all sources
|
|
274
|
+
// of scopes and scope restrictions (temporary credentials, assumeScopes, client scopes,
|
|
275
|
+
// and roles).
|
|
276
|
+
/* eslint-enable max-len */
|
|
277
|
+
currentScopes(...args) {
|
|
278
|
+
this.validate(this.currentScopes.entry, args);
|
|
279
|
+
|
|
280
|
+
return this.request(this.currentScopes.entry, args);
|
|
281
|
+
}
|
|
282
|
+
/* eslint-disable max-len */
|
|
283
|
+
// Get temporary AWS credentials for `read-write` or `read-only` access to
|
|
284
|
+
// a given `bucket` and `prefix` within that bucket.
|
|
285
|
+
// The `level` parameter can be `read-write` or `read-only` and determines
|
|
286
|
+
// which type of credentials are returned. Please note that the `level`
|
|
287
|
+
// parameter is required in the scope guarding access. The bucket name must
|
|
288
|
+
// not contain `.`, as recommended by Amazon.
|
|
289
|
+
// This method can only allow access to a whitelisted set of buckets, as configured
|
|
290
|
+
// in the Taskcluster deployment
|
|
291
|
+
// The credentials are set to expire after an hour, but this behavior is
|
|
292
|
+
// subject to change. Hence, you should always read the `expires` property
|
|
293
|
+
// from the response, if you intend to maintain active credentials in your
|
|
294
|
+
// application.
|
|
295
|
+
// Please note that your `prefix` may not start with slash `/`. Such a prefix
|
|
296
|
+
// is allowed on S3, but we forbid it here to discourage bad behavior.
|
|
297
|
+
// Also note that if your `prefix` doesn't end in a slash `/`, the STS
|
|
298
|
+
// credentials may allow access to unexpected keys, as S3 does not treat
|
|
299
|
+
// slashes specially. For example, a prefix of `my-folder` will allow
|
|
300
|
+
// access to `my-folder/file.txt` as expected, but also to `my-folder.txt`,
|
|
301
|
+
// which may not be intended.
|
|
302
|
+
// Finally, note that the `PutObjectAcl` call is not allowed. Passing a canned
|
|
303
|
+
// ACL other than `private` to `PutObject` is treated as a `PutObjectAcl` call, and
|
|
304
|
+
// will result in an access-denied error from AWS. This limitation is due to a
|
|
305
|
+
// security flaw in Amazon S3 which might otherwise allow indefinite access to
|
|
306
|
+
// uploaded objects.
|
|
307
|
+
// **EC2 metadata compatibility**, if the querystring parameter
|
|
308
|
+
// `?format=iam-role-compat` is given, the response will be compatible
|
|
309
|
+
// with the JSON exposed by the EC2 metadata service. This aims to ease
|
|
310
|
+
// compatibility for libraries and tools built to auto-refresh credentials.
|
|
311
|
+
// For details on the format returned by EC2 metadata service see:
|
|
312
|
+
// [EC2 User Guide](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html#instance-metadata-security-credentials).
|
|
313
|
+
/* eslint-enable max-len */
|
|
314
|
+
awsS3Credentials(...args) {
|
|
315
|
+
this.validate(this.awsS3Credentials.entry, args);
|
|
316
|
+
|
|
317
|
+
return this.request(this.awsS3Credentials.entry, args);
|
|
318
|
+
}
|
|
319
|
+
/* eslint-disable max-len */
|
|
320
|
+
// Retrieve a list of all Azure accounts managed by Taskcluster Auth.
|
|
321
|
+
/* eslint-enable max-len */
|
|
322
|
+
azureAccounts(...args) {
|
|
323
|
+
this.validate(this.azureAccounts.entry, args);
|
|
324
|
+
|
|
325
|
+
return this.request(this.azureAccounts.entry, args);
|
|
326
|
+
}
|
|
327
|
+
/* eslint-disable max-len */
|
|
328
|
+
// Retrieve a list of all tables in an account.
|
|
329
|
+
/* eslint-enable max-len */
|
|
330
|
+
azureTables(...args) {
|
|
331
|
+
this.validate(this.azureTables.entry, args);
|
|
332
|
+
|
|
333
|
+
return this.request(this.azureTables.entry, args);
|
|
334
|
+
}
|
|
335
|
+
/* eslint-disable max-len */
|
|
336
|
+
// Get a shared access signature (SAS) string for use with a specific Azure
|
|
337
|
+
// Table Storage table.
|
|
338
|
+
// The `level` parameter can be `read-write` or `read-only` and determines
|
|
339
|
+
// which type of credentials are returned. If level is read-write, it will create the
|
|
340
|
+
// table if it doesn't already exist.
|
|
341
|
+
/* eslint-enable max-len */
|
|
342
|
+
azureTableSAS(...args) {
|
|
343
|
+
this.validate(this.azureTableSAS.entry, args);
|
|
344
|
+
|
|
345
|
+
return this.request(this.azureTableSAS.entry, args);
|
|
346
|
+
}
|
|
347
|
+
/* eslint-disable max-len */
|
|
348
|
+
// Retrieve a list of all containers in an account.
|
|
349
|
+
/* eslint-enable max-len */
|
|
350
|
+
azureContainers(...args) {
|
|
351
|
+
this.validate(this.azureContainers.entry, args);
|
|
352
|
+
|
|
353
|
+
return this.request(this.azureContainers.entry, args);
|
|
354
|
+
}
|
|
355
|
+
/* eslint-disable max-len */
|
|
356
|
+
// Get a shared access signature (SAS) string for use with a specific Azure
|
|
357
|
+
// Blob Storage container.
|
|
358
|
+
// The `level` parameter can be `read-write` or `read-only` and determines
|
|
359
|
+
// which type of credentials are returned. If level is read-write, it will create the
|
|
360
|
+
// container if it doesn't already exist.
|
|
361
|
+
/* eslint-enable max-len */
|
|
362
|
+
azureContainerSAS(...args) {
|
|
363
|
+
this.validate(this.azureContainerSAS.entry, args);
|
|
364
|
+
|
|
365
|
+
return this.request(this.azureContainerSAS.entry, args);
|
|
366
|
+
}
|
|
367
|
+
/* eslint-disable max-len */
|
|
368
|
+
// Get temporary DSN (access credentials) for a sentry project.
|
|
369
|
+
// The credentials returned can be used with any Sentry client for up to
|
|
370
|
+
// 24 hours, after which the credentials will be automatically disabled.
|
|
371
|
+
// If the project doesn't exist it will be created, and assigned to the
|
|
372
|
+
// initial team configured for this component. Contact a Sentry admin
|
|
373
|
+
// to have the project transferred to a team you have access to if needed
|
|
374
|
+
/* eslint-enable max-len */
|
|
375
|
+
sentryDSN(...args) {
|
|
376
|
+
this.validate(this.sentryDSN.entry, args);
|
|
377
|
+
|
|
378
|
+
return this.request(this.sentryDSN.entry, args);
|
|
379
|
+
}
|
|
380
|
+
/* eslint-disable max-len */
|
|
381
|
+
// Get a temporary token suitable for use connecting to a
|
|
382
|
+
// [websocktunnel](https://github.com/taskcluster/taskcluster/tree/main/tools/websocktunnel) server.
|
|
383
|
+
// The resulting token will only be accepted by servers with a matching audience
|
|
384
|
+
// value. Reaching such a server is the callers responsibility. In general,
|
|
385
|
+
// a server URL or set of URLs should be provided to the caller as configuration
|
|
386
|
+
// along with the audience value.
|
|
387
|
+
// The token is valid for a limited time (on the scale of hours). Callers should
|
|
388
|
+
// refresh it before expiration.
|
|
389
|
+
/* eslint-enable max-len */
|
|
390
|
+
websocktunnelToken(...args) {
|
|
391
|
+
this.validate(this.websocktunnelToken.entry, args);
|
|
392
|
+
|
|
393
|
+
return this.request(this.websocktunnelToken.entry, args);
|
|
394
|
+
}
|
|
395
|
+
/* eslint-disable max-len */
|
|
396
|
+
// Get temporary GCP credentials for the given serviceAccount in the given project.
|
|
397
|
+
// Only preconfigured projects and serviceAccounts are allowed, as defined in the
|
|
398
|
+
// deployment of the Taskcluster services.
|
|
399
|
+
// The credentials are set to expire after an hour, but this behavior is
|
|
400
|
+
// subject to change. Hence, you should always read the `expires` property
|
|
401
|
+
// from the response, if you intend to maintain active credentials in your
|
|
402
|
+
// application.
|
|
403
|
+
/* eslint-enable max-len */
|
|
404
|
+
gcpCredentials(...args) {
|
|
405
|
+
this.validate(this.gcpCredentials.entry, args);
|
|
406
|
+
|
|
407
|
+
return this.request(this.gcpCredentials.entry, args);
|
|
408
|
+
}
|
|
409
|
+
/* eslint-disable max-len */
|
|
410
|
+
// Validate the request signature given on input and return list of scopes
|
|
411
|
+
// that the authenticating client has.
|
|
412
|
+
// This method is used by other services that wish rely on Taskcluster
|
|
413
|
+
// credentials for authentication. This way we can use Hawk without having
|
|
414
|
+
// the secret credentials leave this service.
|
|
415
|
+
/* eslint-enable max-len */
|
|
416
|
+
authenticateHawk(...args) {
|
|
417
|
+
this.validate(this.authenticateHawk.entry, args);
|
|
418
|
+
|
|
419
|
+
return this.request(this.authenticateHawk.entry, args);
|
|
420
|
+
}
|
|
421
|
+
/* eslint-disable max-len */
|
|
422
|
+
// Utility method to test client implementations of Taskcluster
|
|
423
|
+
// authentication.
|
|
424
|
+
// Rather than using real credentials, this endpoint accepts requests with
|
|
425
|
+
// clientId `tester` and accessToken `no-secret`. That client's scopes are
|
|
426
|
+
// based on `clientScopes` in the request body.
|
|
427
|
+
// The request is validated, with any certificate, authorizedScopes, etc.
|
|
428
|
+
// applied, and the resulting scopes are checked against `requiredScopes`
|
|
429
|
+
// from the request body. On success, the response contains the clientId
|
|
430
|
+
// and scopes as seen by the API method.
|
|
431
|
+
/* eslint-enable max-len */
|
|
432
|
+
testAuthenticate(...args) {
|
|
433
|
+
this.validate(this.testAuthenticate.entry, args);
|
|
434
|
+
|
|
435
|
+
return this.request(this.testAuthenticate.entry, args);
|
|
436
|
+
}
|
|
437
|
+
/* eslint-disable max-len */
|
|
438
|
+
// Utility method similar to `testAuthenticate`, but with the GET method,
|
|
439
|
+
// so it can be used with signed URLs (bewits).
|
|
440
|
+
// Rather than using real credentials, this endpoint accepts requests with
|
|
441
|
+
// clientId `tester` and accessToken `no-secret`. That client's scopes are
|
|
442
|
+
// `['test:*', 'auth:create-client:test:*']`. The call fails if the
|
|
443
|
+
// `test:authenticate-get` scope is not available.
|
|
444
|
+
// The request is validated, with any certificate, authorizedScopes, etc.
|
|
445
|
+
// applied, and the resulting scopes are checked, just like any API call.
|
|
446
|
+
// On success, the response contains the clientId and scopes as seen by
|
|
447
|
+
// the API method.
|
|
448
|
+
// This method may later be extended to allow specification of client and
|
|
449
|
+
// required scopes via query arguments.
|
|
450
|
+
/* eslint-enable max-len */
|
|
451
|
+
testAuthenticateGet(...args) {
|
|
452
|
+
this.validate(this.testAuthenticateGet.entry, args);
|
|
453
|
+
|
|
454
|
+
return this.request(this.testAuthenticateGet.entry, args);
|
|
455
|
+
}
|
|
456
|
+
/* eslint-disable max-len */
|
|
457
|
+
// Respond with a service heartbeat.
|
|
458
|
+
// This endpoint is used to check on backing services this service
|
|
459
|
+
// depends on.
|
|
460
|
+
/* eslint-enable max-len */
|
|
461
|
+
heartbeat(...args) {
|
|
462
|
+
this.validate(this.heartbeat.entry, args);
|
|
463
|
+
|
|
464
|
+
return this.request(this.heartbeat.entry, args);
|
|
465
|
+
}
|
|
466
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
|
+
|
|
3
|
+
import Client from '../Client';
|
|
4
|
+
|
|
5
|
+
export default class AuthEvents extends Client {
|
|
6
|
+
constructor(options = {}) {
|
|
7
|
+
super({
|
|
8
|
+
serviceName: 'auth',
|
|
9
|
+
serviceVersion: 'v1',
|
|
10
|
+
exchangePrefix: 'exchange/taskcluster-auth/v1/',
|
|
11
|
+
...options,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
/* eslint-disable max-len */
|
|
15
|
+
// Message that a new client has been created.
|
|
16
|
+
/* eslint-enable max-len */
|
|
17
|
+
clientCreated(pattern) {
|
|
18
|
+
const entry = {"exchange":"client-created","name":"clientCreated","routingKey":[{"multipleWords":true,"name":"reserved","required":false}],"schema":"v1/client-message.json#","type":"topic-exchange"}; // eslint-disable-line
|
|
19
|
+
|
|
20
|
+
return this.normalizePattern(entry, pattern);
|
|
21
|
+
}
|
|
22
|
+
/* eslint-disable max-len */
|
|
23
|
+
// Message that a new client has been updated.
|
|
24
|
+
/* eslint-enable max-len */
|
|
25
|
+
clientUpdated(pattern) {
|
|
26
|
+
const entry = {"exchange":"client-updated","name":"clientUpdated","routingKey":[{"multipleWords":true,"name":"reserved","required":false}],"schema":"v1/client-message.json#","type":"topic-exchange"}; // eslint-disable-line
|
|
27
|
+
|
|
28
|
+
return this.normalizePattern(entry, pattern);
|
|
29
|
+
}
|
|
30
|
+
/* eslint-disable max-len */
|
|
31
|
+
// Message that a new client has been deleted.
|
|
32
|
+
/* eslint-enable max-len */
|
|
33
|
+
clientDeleted(pattern) {
|
|
34
|
+
const entry = {"exchange":"client-deleted","name":"clientDeleted","routingKey":[{"multipleWords":true,"name":"reserved","required":false}],"schema":"v1/client-message.json#","type":"topic-exchange"}; // eslint-disable-line
|
|
35
|
+
|
|
36
|
+
return this.normalizePattern(entry, pattern);
|
|
37
|
+
}
|
|
38
|
+
/* eslint-disable max-len */
|
|
39
|
+
// Message that a new role has been created.
|
|
40
|
+
/* eslint-enable max-len */
|
|
41
|
+
roleCreated(pattern) {
|
|
42
|
+
const entry = {"exchange":"role-created","name":"roleCreated","routingKey":[{"multipleWords":true,"name":"reserved","required":false}],"schema":"v1/role-message.json#","type":"topic-exchange"}; // eslint-disable-line
|
|
43
|
+
|
|
44
|
+
return this.normalizePattern(entry, pattern);
|
|
45
|
+
}
|
|
46
|
+
/* eslint-disable max-len */
|
|
47
|
+
// Message that a new role has been updated.
|
|
48
|
+
/* eslint-enable max-len */
|
|
49
|
+
roleUpdated(pattern) {
|
|
50
|
+
const entry = {"exchange":"role-updated","name":"roleUpdated","routingKey":[{"multipleWords":true,"name":"reserved","required":false}],"schema":"v1/role-message.json#","type":"topic-exchange"}; // eslint-disable-line
|
|
51
|
+
|
|
52
|
+
return this.normalizePattern(entry, pattern);
|
|
53
|
+
}
|
|
54
|
+
/* eslint-disable max-len */
|
|
55
|
+
// Message that a new role has been deleted.
|
|
56
|
+
/* eslint-enable max-len */
|
|
57
|
+
roleDeleted(pattern) {
|
|
58
|
+
const entry = {"exchange":"role-deleted","name":"roleDeleted","routingKey":[{"multipleWords":true,"name":"reserved","required":false}],"schema":"v1/role-message.json#","type":"topic-exchange"}; // eslint-disable-line
|
|
59
|
+
|
|
60
|
+
return this.normalizePattern(entry, pattern);
|
|
61
|
+
}
|
|
62
|
+
}
|