screwdriver-api 7.0.73 → 7.0.75
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
package/plugins/auth/token.js
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
const boom = require('@hapi/boom');
|
|
4
4
|
const schema = require('screwdriver-data-schema');
|
|
5
|
+
const joi = require('joi');
|
|
6
|
+
const buildIdSchema = schema.models.build.base.extract('id');
|
|
7
|
+
const usernameSchema = schema.models.user.base.extract('username');
|
|
5
8
|
|
|
6
9
|
/**
|
|
7
10
|
* Generate a new JSON Web Token
|
|
@@ -55,6 +58,11 @@ module.exports = () => ({
|
|
|
55
58
|
},
|
|
56
59
|
response: {
|
|
57
60
|
schema: schema.api.auth.token
|
|
61
|
+
},
|
|
62
|
+
validate: {
|
|
63
|
+
params: joi.object({
|
|
64
|
+
buildId: joi.alternatives().try(buildIdSchema, usernameSchema)
|
|
65
|
+
})
|
|
58
66
|
}
|
|
59
67
|
}
|
|
60
68
|
});
|
|
@@ -4,6 +4,7 @@ const boom = require('@hapi/boom');
|
|
|
4
4
|
const joi = require('joi');
|
|
5
5
|
const schema = require('screwdriver-data-schema');
|
|
6
6
|
const listSchema = joi.array().items(schema.models.build.getStep).label('List of steps');
|
|
7
|
+
const idSchema = schema.models.build.base.extract('id');
|
|
7
8
|
|
|
8
9
|
module.exports = () => ({
|
|
9
10
|
method: 'GET',
|
|
@@ -61,6 +62,11 @@ module.exports = () => ({
|
|
|
61
62
|
},
|
|
62
63
|
response: {
|
|
63
64
|
schema: listSchema
|
|
65
|
+
},
|
|
66
|
+
validate: {
|
|
67
|
+
params: joi.object({
|
|
68
|
+
id: idSchema
|
|
69
|
+
})
|
|
64
70
|
}
|
|
65
71
|
}
|
|
66
72
|
});
|
|
@@ -62,7 +62,8 @@ module.exports = () => ({
|
|
|
62
62
|
joi.object({
|
|
63
63
|
type: joi.string(),
|
|
64
64
|
prNum: prNumSchema,
|
|
65
|
-
search: joi.forbidden() // we don't support search for Pipeline list events
|
|
65
|
+
search: joi.forbidden(), // we don't support search for Pipeline list events
|
|
66
|
+
getCount: joi.forbidden() // we don't support getCount for Pipeline list events
|
|
66
67
|
})
|
|
67
68
|
)
|
|
68
69
|
}
|
|
@@ -49,7 +49,8 @@ module.exports = () => ({
|
|
|
49
49
|
}),
|
|
50
50
|
query: schema.api.pagination.concat(
|
|
51
51
|
joi.object({
|
|
52
|
-
search: joi.forbidden() // we don't support search for Template list tags
|
|
52
|
+
search: joi.forbidden(), // we don't support search for Template list tags
|
|
53
|
+
getCount: joi.forbidden()
|
|
53
54
|
})
|
|
54
55
|
)
|
|
55
56
|
}
|