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

fixes #207 add a default openapi-inject for portal integration in ope… #208

Merged
merged 1 commit into from
May 30, 2022
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
133 changes: 133 additions & 0 deletions openapi-meta/src/main/resources/config/openapi-inject.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
openapi: 3.0.0
paths:
/health/${server.serviceId}:
get:
description: pass through to the liveness endpoint that belongs to backend api
security:
- admin-scope:
# okta doesn't support either for now
# for control pane to access all businesses' admin endpoints
- admin
# for each business to access their own admin endpoints
- ${server.serviceId}/admin
/server/info:
get:
description: get the proxy server info and corresponding backend service info
security:
- admin-scope:
# okta doesn't support either for now
# for control pane to access all businesses' admin endpoints
- admin
# for each business to access their own admin endpoints
- ${server.serviceId}/admin

/chaosmonkey:
get:
description: to get the current chaosmonkey settings
security:
- admin-scope:
# okta doesn't support either for now
# for control pane to access all businesses' admin endpoints
- admin
# for each business to access their own admin endpoints
- ${server.serviceId}/admin
/chaosmonkey/{assault}:
post:
description: to update chaosmonkey settings
requestBody:
description: to update chaosmonkey settings
required: true
content:
application/json:
schema:
type: object
additionalProperties: true
security:
- admin-scope:
# okta doesn't support either for now
# for control pane to access all businesses' admin endpoints
- admin
# for each business to access their own admin endpoints
- ${server.serviceId}/admin

/logger:
get:
description: to get the current logging settings
security:
- admin-scope:
# okta doesn't support either for now
# for control pane to access all businesses' admin endpoints
- admin
# for each business to access their own admin endpoints
- ${server.serviceId}/admin
post:
description: to modify the logging settings
requestBody:
description: to update logging settings
required: true
security:
- admin-scope:
# okta doesn't support either for now
# for control pane to access all businesses' admin endpoints
- admin
# for each business to access their own admin endpoints
- ${server.serviceId}/admin

/logger/content:
get:
description: to get the content of the logs from this service.
security:
- admin-scope:
- admin
- ${server.serviceId}/admin

/modules:
get:
description: to get the all registered modules and handlers to form a dropdown for module config reload
security:
- admin-scope:
# okta doesn't support either for now
# for control pane to access all businesses' admin endpoints
- admin
# for each business to access their own admin endpoints
- ${server.serviceId}/admin
post:
description: to trigger the config reload for all modules or specified modules selected on control pane
requestBody:
description: to trigger the reload from the config server from the control pane.
required: true
content:
application/json:
schema:
type: array
items:
type: string
security:
- admin-scope:
# okta doesn't support either for now
# for control pane to access all businesses' admin endpoints
- admin
# for each business to access their own admin endpoints
- ${server.serviceId}/admin
/shutdown:
delete:
summary: "Shutdown the service instance to force a restart."
description: "Returns a JSON body of shutdown time"
operationId: "serviceShutdown"
security:
- admin-scope:
# okta doesn't support either for now
# for control pane to access all businesses' admin endpoints
- admin
# for each business to access their own admin endpoints
- ${server.serviceId}/admin

components:
securitySchemes:
admin-scope:
type: oauth2
description: This API uses OAuth 2 with the client credential grant flow.
flows:
clientCredentials:
scopes:
admin: admin scope to access admin endpoints
2 changes: 2 additions & 0 deletions openapi-meta/src/test/resources/config/values.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# server.yml
server.serviceId: com.networknt.petstore-1.0.0
badKey: "{petId}"
goodKey: petId