screwdriver-api 8.0.176 → 8.0.177

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screwdriver-api",
3
- "version": "8.0.176",
3
+ "version": "8.0.177",
4
4
  "description": "API server for the Screwdriver.cd service",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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 { 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 { 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 { bannerFactory } = request.server.app;
@@ -19,6 +19,11 @@ module.exports = () => ({
19
19
  strategies: ['token'],
20
20
  scope: ['user', '!guest']
21
21
  },
22
+ plugins: {
23
+ authorization: {
24
+ permission: 'all'
25
+ }
26
+ },
22
27
 
23
28
  handler: async (request, h) => {
24
29
  const { collectionFactory, pipelineFactory, userFactory } = request.server.app;
@@ -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
  // Check if the collection to be created has a type 'default'
@@ -17,6 +17,11 @@ module.exports = () => ({
17
17
  strategies: ['token'],
18
18
  scope: ['user', '!guest']
19
19
  },
20
+ plugins: {
21
+ authorization: {
22
+ permission: 'read'
23
+ }
24
+ },
20
25
 
21
26
  handler: async (request, h) => {
22
27
  const { collectionFactory, pipelineFactory, userFactory } = request.server.app;
@@ -15,6 +15,11 @@ module.exports = () => ({
15
15
  strategies: ['token'],
16
16
  scope: ['user', '!guest']
17
17
  },
18
+ plugins: {
19
+ authorization: {
20
+ permission: 'read'
21
+ }
22
+ },
18
23
 
19
24
  handler: async (request, h) => {
20
25
  const { userFactory, collectionFactory } = 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 { collectionFactory, userFactory } = request.server.app;
@@ -19,6 +19,11 @@ module.exports = () => ({
19
19
  strategies: ['token'],
20
20
  scope: ['user', '!guest']
21
21
  },
22
+ plugins: {
23
+ authorization: {
24
+ permission: 'all'
25
+ }
26
+ },
22
27
 
23
28
  handler: async (request, h) => {
24
29
  const { collectionFactory, userFactory } = 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
  // Check if the collection is to be updated as a default collection
@@ -20,6 +20,11 @@ module.exports = () => ({
20
20
  strategies: ['token'],
21
21
  scope: ['user', 'build']
22
22
  },
23
+ plugins: {
24
+ authorization: {
25
+ permission: 'read'
26
+ }
27
+ },
23
28
 
24
29
  handler: async (request, h) => {
25
30
  const { commandFactory } = request.server.app;
@@ -29,6 +29,11 @@ module.exports = () => ({
29
29
  strategies: ['token'],
30
30
  scope: ['user', 'build']
31
31
  },
32
+ plugins: {
33
+ authorization: {
34
+ permission: 'read'
35
+ }
36
+ },
32
37
 
33
38
  handler: async (request, h) => {
34
39
  const factory = request.server.app.commandFactory;
@@ -17,6 +17,11 @@ module.exports = () => ({
17
17
  strategies: ['token'],
18
18
  scope: ['user', 'build']
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.commandTagFactory;
@@ -18,6 +18,11 @@ module.exports = () => ({
18
18
  strategies: ['token'],
19
19
  scope: ['user', '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.commandFactory;
@@ -44,6 +44,11 @@ module.exports = () => ({
44
44
  strategies: ['token'],
45
45
  scope: ['build', 'user', '!guest']
46
46
  },
47
+ plugins: {
48
+ authorization: {
49
+ permission: 'all'
50
+ }
51
+ },
47
52
 
48
53
  handler: async (request, h) => {
49
54
  const { namespace, name } = request.params;
@@ -19,6 +19,7 @@ module.exports = () => ({
19
19
  strategies: ['token'],
20
20
  scope: ['build']
21
21
  },
22
+
22
23
  handler: async (request, h) => {
23
24
  const { pipelineFactory, commandFactory, commandTagFactory } = request.server.app;
24
25
  const { pipelineId, isPR } = request.auth.credentials;
@@ -16,6 +16,11 @@ module.exports = () => ({
16
16
  strategies: ['token'],
17
17
  scope: ['build', 'user', '!guest']
18
18
  },
19
+ plugins: {
20
+ authorization: {
21
+ permission: 'all'
22
+ }
23
+ },
19
24
  handler: async (request, h) => {
20
25
  const { namespace, name, version } = request.params;
21
26
  const { credentials } = request.auth;
@@ -16,6 +16,11 @@ module.exports = () => ({
16
16
  strategies: ['token'],
17
17
  scope: ['admin', '!guest']
18
18
  },
19
+ plugins: {
20
+ authorization: {
21
+ permission: 'all'
22
+ }
23
+ },
19
24
 
20
25
  handler: async (request, h) => {
21
26
  const { name, namespace } = request.params;
@@ -19,6 +19,11 @@ module.exports = () => ({
19
19
  strategies: ['token'],
20
20
  scope: ['user', 'build']
21
21
  },
22
+ plugins: {
23
+ authorization: {
24
+ permission: 'read'
25
+ }
26
+ },
22
27
 
23
28
  handler: async (request, h) => {
24
29
  const { templateFactory } = request.server.app;
@@ -19,6 +19,11 @@ module.exports = () => ({
19
19
  strategies: ['token'],
20
20
  scope: ['user', 'build']
21
21
  },
22
+ plugins: {
23
+ authorization: {
24
+ permission: 'read'
25
+ }
26
+ },
22
27
 
23
28
  handler: async (request, h) => {
24
29
  const { templateFactory } = request.server.app;
@@ -17,6 +17,11 @@ module.exports = () => ({
17
17
  strategies: ['token'],
18
18
  scope: ['user', 'build']
19
19
  },
20
+ plugins: {
21
+ authorization: {
22
+ permission: 'read'
23
+ }
24
+ },
20
25
 
21
26
  handler: async (request, h) => {
22
27
  const { templateFactory } = request.server.app;
@@ -29,6 +29,11 @@ module.exports = () => ({
29
29
  strategies: ['token'],
30
30
  scope: ['user', 'build']
31
31
  },
32
+ plugins: {
33
+ authorization: {
34
+ permission: 'read'
35
+ }
36
+ },
32
37
 
33
38
  handler: async (request, h) => {
34
39
  const factory = request.server.app.templateFactory;
@@ -16,6 +16,11 @@ module.exports = () => ({
16
16
  strategies: ['token'],
17
17
  scope: ['user', 'build']
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.templateTagFactory;
@@ -17,6 +17,11 @@ module.exports = () => ({
17
17
  strategies: ['token'],
18
18
  scope: ['user', 'build']
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.templateFactory;
@@ -16,6 +16,11 @@ module.exports = () => ({
16
16
  strategies: ['token'],
17
17
  scope: ['user', 'build']
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.templateFactory;
@@ -16,6 +16,11 @@ module.exports = () => ({
16
16
  strategies: ['token'],
17
17
  scope: ['build', 'user', '!guest']
18
18
  },
19
+ plugins: {
20
+ authorization: {
21
+ permission: 'all'
22
+ }
23
+ },
19
24
 
20
25
  handler: async (request, h) => {
21
26
  const { name } = request.params;
@@ -17,6 +17,11 @@ module.exports = () => ({
17
17
  strategies: ['token'],
18
18
  scope: ['build', 'user', '!guest']
19
19
  },
20
+ plugins: {
21
+ authorization: {
22
+ permission: 'all'
23
+ }
24
+ },
20
25
 
21
26
  handler: async (request, h) => {
22
27
  const { name, version } = request.params;
@@ -16,6 +16,11 @@ module.exports = () => ({
16
16
  strategies: ['token'],
17
17
  scope: ['admin', '!guest']
18
18
  },
19
+ plugins: {
20
+ authorization: {
21
+ permission: 'all'
22
+ }
23
+ },
19
24
 
20
25
  handler: async (request, h) => {
21
26
  const { name } = request.params;
@@ -19,12 +19,22 @@ module.exports = () => ({
19
19
  strategies: ['token'],
20
20
  scope: ['admin', '!guest']
21
21
  },
22
+ plugins: {
23
+ authorization: {
24
+ permission: 'read'
25
+ }
26
+ },
22
27
 
23
28
  handler: async (request, h) => {
24
29
  const { username } = request.params;
25
30
  const { userFactory } = request.server.app;
26
31
  const { scmContext, includeUserToken } = request.query;
27
32
  const { credentials } = request.auth;
33
+ const { permission = 'all' } = credentials;
34
+
35
+ if (includeUserToken && permission !== 'all') {
36
+ throw boom.forbidden('All permission is required to request user token');
37
+ }
28
38
 
29
39
  const user = await userFactory.get({
30
40
  username,
@@ -13,6 +13,11 @@ module.exports = () => ({
13
13
  strategies: ['token'],
14
14
  scope: ['user', '!guest']
15
15
  },
16
+ plugins: {
17
+ authorization: {
18
+ permission: 'all'
19
+ }
20
+ },
16
21
 
17
22
  handler: async (request, h) => {
18
23
  const { userFactory } = request.server.app;
@@ -15,6 +15,11 @@ module.exports = () => ({
15
15
  strategies: ['token'],
16
16
  scope: ['user', '!guest']
17
17
  },
18
+ plugins: {
19
+ authorization: {
20
+ permission: 'read'
21
+ }
22
+ },
18
23
 
19
24
  handler: async (request, h) => {
20
25
  const { userFactory } = request.server.app;
@@ -14,6 +14,11 @@ module.exports = () => ({
14
14
  strategies: ['token'],
15
15
  scope: ['user', '!guest']
16
16
  },
17
+ plugins: {
18
+ authorization: {
19
+ permission: 'all'
20
+ }
21
+ },
17
22
 
18
23
  handler: async (request, h) => {
19
24
  const { userFactory } = request.server.app;