Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating test from int #1155

Merged
merged 7 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
286 changes: 286 additions & 0 deletions api-docs/openapi.json

Large diffs are not rendered by default.

25 changes: 14 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"JSONStream": "^1.3.5",
"kleur": "^4.1.4",
"lodash": "^4.17.21",
"luxon": "^3.4.4",
"mongo-cursor-pagination": "^8.1.3",
"mongoose": "^5.13.20",
"mongoose-aggregate-paginate-v2": "1.0.6",
Expand All @@ -54,7 +55,6 @@
"swagger-autogen": "^2.19.0",
"swagger-ui-express": "^4.3.0",
"uuid": "^8.3.2",
"validate-date": "^2.0.0",
"validator": ">=13.7.0",
"winston": "^3.2.1",
"yamljs": "^0.3.0"
Expand Down
182 changes: 182 additions & 0 deletions src/controller/cve-id.controller/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,32 @@ router.get('/cve-id/:id',
]
#swagger.responses[200] = {
description: 'The requested CVE ID information is returned',
headers: {
"RateLimit-Limit": {
schema: {
type: "integer"
},
description: "Indicates the service limit associated with the client in the current time window. If the client exceeds that limit, it MAY not be served."
},
"RateLimit-Policy": {
schema: {
type: "string"
},
description: "Indicates a service policy currently associated with the client. Its value is informative."
},
"RateLimit-Remaining": {
schema: {
type: "integer"
},
description: "Indicates the remaining quota units associated with the expiring-limit. Clients MUST NOT assume that a positive remaining value is a guarantee that further requests will be served. When the value of the remaining keyword is low, it indicates that the server may soon throttle the client."
},
"RateLimit-Reset": {
schema: {
type: "integer"
},
description: "Indicates the number of seconds until the available quota units associated with the expiring-limit resets."
}
},
content: {
"application/json": {
schema: { $ref: '../schemas/cve-id/get-cve-id-response.json' }
Expand All @@ -216,6 +242,32 @@ router.get('/cve-id/:id',
}
#swagger.responses[400] = {
description: 'Bad Request',
headers: {
"RateLimit-Limit": {
schema: {
type: "integer"
},
description: "Indicates the service limit associated with the client in the current time window. If the client exceeds that limit, it MAY not be served."
},
"RateLimit-Policy": {
schema: {
type: "string"
},
description: "Indicates a service policy currently associated with the client. Its value is informative."
},
"RateLimit-Remaining": {
schema: {
type: "integer"
},
description: "Indicates the remaining quota units associated with the expiring-limit. Clients MUST NOT assume that a positive remaining value is a guarantee that further requests will be served. When the value of the remaining keyword is low, it indicates that the server may soon throttle the client."
},
"RateLimit-Reset": {
schema: {
type: "integer"
},
description: "Indicates the number of seconds until the available quota units associated with the expiring-limit resets."
}
},
content: {
"application/json": {
schema: { $ref: '../schemas/errors/bad-request.json' }
Expand All @@ -224,6 +276,32 @@ router.get('/cve-id/:id',
}
#swagger.responses[401] = {
description: 'Not Authenticated',
headers: {
"RateLimit-Limit": {
schema: {
type: "integer"
},
description: "Indicates the service limit associated with the client in the current time window. If the client exceeds that limit, it MAY not be served."
},
"RateLimit-Policy": {
schema: {
type: "string"
},
description: "Indicates a service policy currently associated with the client. Its value is informative."
},
"RateLimit-Remaining": {
schema: {
type: "integer"
},
description: "Indicates the remaining quota units associated with the expiring-limit. Clients MUST NOT assume that a positive remaining value is a guarantee that further requests will be served. When the value of the remaining keyword is low, it indicates that the server may soon throttle the client."
},
"RateLimit-Reset": {
schema: {
type: "integer"
},
description: "Indicates the number of seconds until the available quota units associated with the expiring-limit resets."
}
},
content: {
"application/json": {
schema: { $ref: '../schemas/errors/generic.json' }
Expand All @@ -232,6 +310,32 @@ router.get('/cve-id/:id',
}
#swagger.responses[403] = {
description: 'Forbidden',
headers: {
"RateLimit-Limit": {
schema: {
type: "integer"
},
description: "Indicates the service limit associated with the client in the current time window. If the client exceeds that limit, it MAY not be served."
},
"RateLimit-Policy": {
schema: {
type: "string"
},
description: "Indicates a service policy currently associated with the client. Its value is informative."
},
"RateLimit-Remaining": {
schema: {
type: "integer"
},
description: "Indicates the remaining quota units associated with the expiring-limit. Clients MUST NOT assume that a positive remaining value is a guarantee that further requests will be served. When the value of the remaining keyword is low, it indicates that the server may soon throttle the client."
},
"RateLimit-Reset": {
schema: {
type: "integer"
},
description: "Indicates the number of seconds until the available quota units associated with the expiring-limit resets."
}
},
content: {
"application/json": {
schema: { $ref: '../schemas/errors/generic.json' }
Expand All @@ -240,6 +344,32 @@ router.get('/cve-id/:id',
}
#swagger.responses[404] = {
description: 'Not Found',
headers: {
"RateLimit-Limit": {
schema: {
type: "integer"
},
description: "Indicates the service limit associated with the client in the current time window. If the client exceeds that limit, it MAY not be served."
},
"RateLimit-Policy": {
schema: {
type: "string"
},
description: "Indicates a service policy currently associated with the client. Its value is informative."
},
"RateLimit-Remaining": {
schema: {
type: "integer"
},
description: "Indicates the remaining quota units associated with the expiring-limit. Clients MUST NOT assume that a positive remaining value is a guarantee that further requests will be served. When the value of the remaining keyword is low, it indicates that the server may soon throttle the client."
},
"RateLimit-Reset": {
schema: {
type: "integer"
},
description: "Indicates the number of seconds until the available quota units associated with the expiring-limit resets."
}
},
content: {
"application/json": {
schema: { $ref: '../schemas/errors/generic.json' }
Expand All @@ -248,6 +378,32 @@ router.get('/cve-id/:id',
}
#swagger.responses[429] = {
description: 'Too Many Requests',
headers: {
"RateLimit-Limit": {
schema: {
type: "integer"
},
description: "Indicates the service limit associated with the client in the current time window. If the client exceeds that limit, it MAY not be served."
},
"RateLimit-Policy": {
schema: {
type: "string"
},
description: "Indicates a service policy currently associated with the client. Its value is informative."
},
"RateLimit-Remaining": {
schema: {
type: "integer"
},
description: "Indicates the remaining quota units associated with the expiring-limit. Clients MUST NOT assume that a positive remaining value is a guarantee that further requests will be served. When the value of the remaining keyword is low, it indicates that the server may soon throttle the client."
},
"RateLimit-Reset": {
schema: {
type: "integer"
},
description: "Indicates the number of seconds until the available quota units associated with the expiring-limit resets."
}
},
content: {
"application/json": {
schema: { $ref: '../schemas/errors/generic.json' }
Expand All @@ -256,6 +412,32 @@ router.get('/cve-id/:id',
}
#swagger.responses[500] = {
description: 'Internal Server Error',
headers: {
"RateLimit-Limit": {
schema: {
type: "integer"
},
description: "Indicates the service limit associated with the client in the current time window. If the client exceeds that limit, it MAY not be served."
},
"RateLimit-Policy": {
schema: {
type: "string"
},
description: "Indicates a service policy currently associated with the client. Its value is informative."
},
"RateLimit-Remaining": {
schema: {
type: "integer"
},
description: "Indicates the remaining quota units associated with the expiring-limit. Clients MUST NOT assume that a positive remaining value is a guarantee that further requests will be served. When the value of the remaining keyword is low, it indicates that the server may soon throttle the client."
},
"RateLimit-Reset": {
schema: {
type: "integer"
},
description: "Indicates the number of seconds until the available quota units associated with the expiring-limit resets."
}
},
content: {
"application/json": {
schema: { $ref: '../schemas/errors/generic.json' }
Expand Down
Loading
Loading