screwdriver-api 8.0.178 → 8.0.180
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/package.json +1 -1
- package/plugins/auth/index.js +2 -2
- package/plugins/auth/token.js +3 -3
- package/plugins/buildClusters/create.js +5 -0
- package/plugins/buildClusters/get.js +5 -0
- package/plugins/buildClusters/list.js +5 -0
- package/plugins/buildClusters/remove.js +5 -0
- package/plugins/buildClusters/update.js +5 -0
- package/plugins/builds/artifacts/get.js +5 -0
- package/plugins/builds/artifacts/getAll.js +5 -0
- package/plugins/builds/artifacts/unzip.js +5 -0
- package/plugins/builds/create.js +3 -0
- package/plugins/builds/get.js +5 -0
- package/plugins/builds/getBuildStatuses.js +5 -0
- package/plugins/builds/listSecrets.js +5 -0
- package/plugins/builds/metrics.js +5 -0
- package/plugins/builds/steps/get.js +5 -0
- package/plugins/builds/steps/list.js +5 -0
- package/plugins/builds/steps/logs.js +5 -0
- package/plugins/builds/update.js +5 -0
- package/plugins/coverage/info.js +5 -0
- package/plugins/isAdmin.js +3 -0
- package/plugins/jobs/buildCluster/remove.js +5 -0
- package/plugins/jobs/buildCluster/update.js +5 -0
- package/plugins/jobs/get.js +5 -0
- package/plugins/jobs/lastSuccessfulMeta.js +5 -0
- package/plugins/jobs/latestBuild.js +5 -0
- package/plugins/jobs/listBuilds.js +5 -0
- package/plugins/jobs/metrics.js +5 -0
- package/plugins/jobs/notify.js +5 -0
- package/plugins/jobs/update.js +5 -0
- package/plugins/secrets/create.js +5 -0
- package/plugins/secrets/get.js +5 -0
- package/plugins/secrets/remove.js +5 -0
- package/plugins/secrets/update.js +5 -0
- package/plugins/stages/get.js +5 -0
- package/plugins/stages/stageBuilds/list.js +5 -0
- package/plugins/tokens/create.js +5 -0
- package/plugins/tokens/list.js +5 -0
- package/plugins/tokens/refresh.js +5 -0
- package/plugins/tokens/remove.js +5 -0
- package/plugins/tokens/update.js +5 -0
package/package.json
CHANGED
package/plugins/auth/index.js
CHANGED
|
@@ -115,13 +115,13 @@ const authPlugin = {
|
|
|
115
115
|
throw boom.unauthorized();
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
const credentials = request.auth
|
|
118
|
+
const { credentials } = request.auth;
|
|
119
119
|
|
|
120
120
|
if (!credentials.auth || credentials.auth.type !== 'api_token') {
|
|
121
121
|
return h.continue;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
const apiTokenId = credentials.auth
|
|
124
|
+
const { apiTokenId } = credentials.auth;
|
|
125
125
|
|
|
126
126
|
if (!apiTokenId) {
|
|
127
127
|
throw boom.forbidden(`Your token is invalid`);
|
package/plugins/auth/token.js
CHANGED
|
@@ -29,13 +29,13 @@ module.exports = () => ({
|
|
|
29
29
|
},
|
|
30
30
|
handler: async (request, h) => {
|
|
31
31
|
let profile = request.auth.credentials;
|
|
32
|
-
const { scope, token, username } = profile;
|
|
32
|
+
const { scope, token, username, permission = 'all' } = profile;
|
|
33
33
|
const { buildFactory, jobFactory, pipelineFactory } = request.server.app;
|
|
34
34
|
|
|
35
35
|
// Check Build ID impersonate
|
|
36
36
|
if (request.params.buildId) {
|
|
37
|
-
if (!scope.includes('admin')) {
|
|
38
|
-
return boom.forbidden(`User ${username}
|
|
37
|
+
if (!scope.includes('admin') || permission !== 'all') {
|
|
38
|
+
return boom.forbidden(`User ${username} must be an admin with all permission to impersonate`);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
const build = await buildFactory.get(request.params.buildId);
|
|
@@ -15,6 +15,11 @@ module.exports = () => ({
|
|
|
15
15
|
strategies: ['token'],
|
|
16
16
|
scope: ['user', '!guest']
|
|
17
17
|
},
|
|
18
|
+
plugins: {
|
|
19
|
+
authorization: {
|
|
20
|
+
permission: 'all'
|
|
21
|
+
}
|
|
22
|
+
},
|
|
18
23
|
|
|
19
24
|
handler: async (request, h) => {
|
|
20
25
|
const { buildClusterFactory, bannerFactory } = request.server.app;
|
|
@@ -16,6 +16,11 @@ module.exports = () => ({
|
|
|
16
16
|
strategies: ['token'],
|
|
17
17
|
scope: ['user', '!guest']
|
|
18
18
|
},
|
|
19
|
+
plugins: {
|
|
20
|
+
authorization: {
|
|
21
|
+
permission: 'all'
|
|
22
|
+
}
|
|
23
|
+
},
|
|
19
24
|
|
|
20
25
|
handler: async (request, h) => {
|
|
21
26
|
const { buildClusterFactory, userFactory, bannerFactory } = request.server.app;
|
|
@@ -16,6 +16,11 @@ module.exports = () => ({
|
|
|
16
16
|
strategies: ['token'],
|
|
17
17
|
scope: ['user', '!guest']
|
|
18
18
|
},
|
|
19
|
+
plugins: {
|
|
20
|
+
authorization: {
|
|
21
|
+
permission: 'all'
|
|
22
|
+
}
|
|
23
|
+
},
|
|
19
24
|
|
|
20
25
|
handler: async (request, h) => {
|
|
21
26
|
const { buildClusterFactory, bannerFactory } = request.server.app;
|
|
@@ -28,6 +28,11 @@ module.exports = config => ({
|
|
|
28
28
|
strategies: ['session', 'token'],
|
|
29
29
|
scope: ['user', 'build', 'pipeline']
|
|
30
30
|
},
|
|
31
|
+
plugins: {
|
|
32
|
+
authorization: {
|
|
33
|
+
permission: 'read'
|
|
34
|
+
}
|
|
35
|
+
},
|
|
31
36
|
|
|
32
37
|
handler: async (req, h) => {
|
|
33
38
|
const { name: artifact, id: buildId } = req.params;
|
package/plugins/builds/create.js
CHANGED
package/plugins/builds/get.js
CHANGED
|
@@ -17,6 +17,11 @@ module.exports = () => ({
|
|
|
17
17
|
strategies: ['token'],
|
|
18
18
|
scope: ['user', 'build', '!guest']
|
|
19
19
|
},
|
|
20
|
+
plugins: {
|
|
21
|
+
authorization: {
|
|
22
|
+
permission: 'read'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
20
25
|
|
|
21
26
|
handler: async (request, h) => {
|
|
22
27
|
const factory = request.server.app.buildFactory;
|
|
@@ -19,6 +19,11 @@ module.exports = () => ({
|
|
|
19
19
|
strategies: ['token'],
|
|
20
20
|
scope: ['user', '!guest', 'build']
|
|
21
21
|
},
|
|
22
|
+
plugins: {
|
|
23
|
+
authorization: {
|
|
24
|
+
permission: 'read'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
22
27
|
|
|
23
28
|
handler: async (request, h) => {
|
|
24
29
|
const factory = request.server.app.buildFactory;
|
|
@@ -17,6 +17,11 @@ module.exports = () => ({
|
|
|
17
17
|
strategies: ['token'],
|
|
18
18
|
scope: ['user', 'build', 'pipeline', '!guest', 'temporal']
|
|
19
19
|
},
|
|
20
|
+
plugins: {
|
|
21
|
+
authorization: {
|
|
22
|
+
permission: 'read'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
20
25
|
|
|
21
26
|
handler: async (request, h) => {
|
|
22
27
|
const { stepFactory } = request.server.app;
|
|
@@ -289,6 +289,11 @@ module.exports = config => ({
|
|
|
289
289
|
strategies: ['token', 'session'],
|
|
290
290
|
scope: ['user', 'pipeline', 'build']
|
|
291
291
|
},
|
|
292
|
+
plugins: {
|
|
293
|
+
authorization: {
|
|
294
|
+
permission: 'read'
|
|
295
|
+
}
|
|
296
|
+
},
|
|
292
297
|
|
|
293
298
|
handler: (req, h) => {
|
|
294
299
|
const { credentials } = req.auth;
|
package/plugins/builds/update.js
CHANGED
|
@@ -90,6 +90,11 @@ module.exports = () => ({
|
|
|
90
90
|
strategies: ['token'],
|
|
91
91
|
scope: ['build', 'pipeline', 'user', '!guest', 'temporal']
|
|
92
92
|
},
|
|
93
|
+
plugins: {
|
|
94
|
+
authorization: {
|
|
95
|
+
permission: 'execute'
|
|
96
|
+
}
|
|
97
|
+
},
|
|
93
98
|
|
|
94
99
|
handler: async (request, h) => {
|
|
95
100
|
const { buildFactory } = request.server.app;
|
package/plugins/coverage/info.js
CHANGED
|
@@ -11,6 +11,11 @@ module.exports = config => ({
|
|
|
11
11
|
strategies: ['token'],
|
|
12
12
|
scope: ['user', 'build']
|
|
13
13
|
},
|
|
14
|
+
plugins: {
|
|
15
|
+
authorization: {
|
|
16
|
+
permission: 'read'
|
|
17
|
+
}
|
|
18
|
+
},
|
|
14
19
|
|
|
15
20
|
handler: async (request, h) => {
|
|
16
21
|
const data = await config.coveragePlugin.getInfo(request.query);
|
package/plugins/isAdmin.js
CHANGED
|
@@ -17,6 +17,11 @@ module.exports = () => ({
|
|
|
17
17
|
strategies: ['token'],
|
|
18
18
|
scope: ['user', '!guest']
|
|
19
19
|
},
|
|
20
|
+
plugins: {
|
|
21
|
+
authorization: {
|
|
22
|
+
permission: 'all'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
20
25
|
|
|
21
26
|
handler: async (request, h) => {
|
|
22
27
|
const { jobFactory, bannerFactory, userFactory, pipelineFactory } = request.server.app;
|
|
@@ -17,6 +17,11 @@ module.exports = () => ({
|
|
|
17
17
|
strategies: ['token'],
|
|
18
18
|
scope: ['user', '!guest']
|
|
19
19
|
},
|
|
20
|
+
plugins: {
|
|
21
|
+
authorization: {
|
|
22
|
+
permission: 'all'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
20
25
|
handler: async (request, h) => {
|
|
21
26
|
const adminAnnotation = 'screwdriver.cd/sdAdminBuildClusterOverride';
|
|
22
27
|
const { payload } = request;
|
package/plugins/jobs/get.js
CHANGED
|
@@ -17,6 +17,11 @@ module.exports = () => ({
|
|
|
17
17
|
strategies: ['token'],
|
|
18
18
|
scope: ['user', 'build', 'pipeline']
|
|
19
19
|
},
|
|
20
|
+
plugins: {
|
|
21
|
+
authorization: {
|
|
22
|
+
permission: 'read'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
20
25
|
|
|
21
26
|
handler: async (request, h) => {
|
|
22
27
|
const factory = request.server.app.jobFactory;
|
|
@@ -16,6 +16,11 @@ module.exports = () => ({
|
|
|
16
16
|
strategies: ['token'],
|
|
17
17
|
scope: ['user', 'build', 'pipeline']
|
|
18
18
|
},
|
|
19
|
+
plugins: {
|
|
20
|
+
authorization: {
|
|
21
|
+
permission: 'read'
|
|
22
|
+
}
|
|
23
|
+
},
|
|
19
24
|
|
|
20
25
|
handler: async (request, h) => {
|
|
21
26
|
const factory = request.server.app.jobFactory;
|
|
@@ -18,6 +18,11 @@ module.exports = () => ({
|
|
|
18
18
|
strategies: ['token'],
|
|
19
19
|
scope: ['user', 'pipeline', 'build']
|
|
20
20
|
},
|
|
21
|
+
plugins: {
|
|
22
|
+
authorization: {
|
|
23
|
+
permission: 'read'
|
|
24
|
+
}
|
|
25
|
+
},
|
|
21
26
|
|
|
22
27
|
handler: async (request, h) => {
|
|
23
28
|
const factory = request.server.app.jobFactory;
|
package/plugins/jobs/metrics.js
CHANGED
|
@@ -19,6 +19,11 @@ module.exports = () => ({
|
|
|
19
19
|
strategies: ['token'],
|
|
20
20
|
scope: ['user', '!guest', 'pipeline']
|
|
21
21
|
},
|
|
22
|
+
plugins: {
|
|
23
|
+
authorization: {
|
|
24
|
+
permission: 'read'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
22
27
|
|
|
23
28
|
handler: async (request, h) => {
|
|
24
29
|
const factory = request.server.app.jobFactory;
|
package/plugins/jobs/notify.js
CHANGED
package/plugins/jobs/update.js
CHANGED
|
@@ -17,6 +17,11 @@ module.exports = () => ({
|
|
|
17
17
|
strategies: ['token'],
|
|
18
18
|
scope: ['user', '!guest', 'pipeline']
|
|
19
19
|
},
|
|
20
|
+
plugins: {
|
|
21
|
+
authorization: {
|
|
22
|
+
permission: 'write'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
20
25
|
|
|
21
26
|
handler: async (request, h) => {
|
|
22
27
|
const { jobFactory, pipelineFactory, userFactory, bannerFactory } = request.server.app;
|
|
@@ -17,6 +17,11 @@ module.exports = () => ({
|
|
|
17
17
|
strategies: ['token'],
|
|
18
18
|
scope: ['user', '!guest', 'pipeline']
|
|
19
19
|
},
|
|
20
|
+
plugins: {
|
|
21
|
+
authorization: {
|
|
22
|
+
permission: 'all'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
20
25
|
|
|
21
26
|
handler: async (request, h) => {
|
|
22
27
|
const { pipelineFactory, secretFactory, userFactory } = request.server.app;
|
package/plugins/secrets/get.js
CHANGED
|
@@ -17,6 +17,11 @@ module.exports = () => ({
|
|
|
17
17
|
strategies: ['token'],
|
|
18
18
|
scope: ['user', '!guest', 'pipeline']
|
|
19
19
|
},
|
|
20
|
+
plugins: {
|
|
21
|
+
authorization: {
|
|
22
|
+
permission: 'all'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
20
25
|
|
|
21
26
|
handler: async (request, h) => {
|
|
22
27
|
const factory = request.server.app.secretFactory;
|
package/plugins/stages/get.js
CHANGED
|
@@ -18,6 +18,11 @@ module.exports = () => ({
|
|
|
18
18
|
strategies: ['token'],
|
|
19
19
|
scope: ['user', '!guest']
|
|
20
20
|
},
|
|
21
|
+
plugins: {
|
|
22
|
+
authorization: {
|
|
23
|
+
permission: 'read'
|
|
24
|
+
}
|
|
25
|
+
},
|
|
21
26
|
|
|
22
27
|
handler: async (request, h) => {
|
|
23
28
|
const { stageFactory, stageBuildFactory } = request.server.app;
|
package/plugins/tokens/create.js
CHANGED
package/plugins/tokens/list.js
CHANGED
package/plugins/tokens/remove.js
CHANGED
package/plugins/tokens/update.js
CHANGED