Skip to content

Commit

Permalink
Merge pull request #1154 from CVEProject/dev
Browse files Browse the repository at this point in the history
Updating Int from Dev
  • Loading branch information
david-rocca committed Dec 12, 2023
2 parents f28c621 + 8b51241 commit 617d201
Show file tree
Hide file tree
Showing 7 changed files with 611 additions and 18 deletions.
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

0 comments on commit 617d201

Please sign in to comment.