-
Notifications
You must be signed in to change notification settings - Fork 0
docs: align public API usage with owner contracts #6
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ info: | |
| name: GNU Affero General Public License v3.0 only | ||
| identifier: AGPL-3.0-only | ||
| servers: | ||
| - url: https://workbench.mavula.dev | ||
| - url: https://workbench.mavula.io | ||
| description: Workbench public endpoint | ||
| security: [{ bearerAuth: [] }] | ||
| tags: | ||
|
|
@@ -27,6 +27,9 @@ paths: | |
| description: Submit tenant-scoped payment work. The tenant is always derived from the access token. | ||
| tags: [Jobs] | ||
| x-mavula-permissions: [workbench.jobs.write] | ||
| parameters: | ||
| - { $ref: '#/components/parameters/IdempotencyKey' } | ||
| - { $ref: '#/components/parameters/CorrelationId' } | ||
| requestBody: | ||
| required: true | ||
| content: | ||
|
|
@@ -35,9 +38,7 @@ paths: | |
| examples: | ||
| payment_capture: | ||
| value: | ||
| queue: payments | ||
| type: PAYMENT_CAPTURE | ||
| max_attempts: 3 | ||
| payload: | ||
| idempotency_key: payment_capture_20260715_001 | ||
| correlation_id: checkout_20260715_001 | ||
|
|
@@ -52,6 +53,8 @@ paths: | |
| '400': { $ref: '#/components/responses/BadRequest' } | ||
| '401': { $ref: '#/components/responses/Unauthorized' } | ||
| '403': { $ref: '#/components/responses/Forbidden' } | ||
| '409': { $ref: '#/components/responses/Conflict' } | ||
| '503': { $ref: '#/components/responses/ServiceUnavailable' } | ||
| /api/jobs/{jobId}: | ||
| get: | ||
| operationId: getJob | ||
|
|
@@ -289,18 +292,40 @@ components: | |
| additionalProperties: false | ||
| properties: { limit: { type: integer, minimum: 1, maximum: 500 } } | ||
| CreateJob: | ||
| oneOf: | ||
| - $ref: '#/components/schemas/CreatePaymentCaptureJob' | ||
| - $ref: '#/components/schemas/CreatePaymentDisbursementJob' | ||
| - $ref: '#/components/schemas/CreatePaymentSettlementJob' | ||
| - $ref: '#/components/schemas/CreatePaymentReconciliationJob' | ||
| discriminator: { propertyName: type } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Sem Useful? React with 👍 / 👎. |
||
| CreatePaymentCaptureJob: | ||
| type: object | ||
| additionalProperties: false | ||
| required: [type, payload] | ||
| properties: | ||
| type: { type: string, enum: [PAYMENT_CAPTURE, PAYMENT_DISBURSEMENT, PAYMENT_SETTLEMENT, PAYMENT_RECONCILIATION] } | ||
| queue: { type: string, const: payments, default: payments } | ||
| payload: | ||
| oneOf: | ||
| - $ref: '#/components/schemas/PaymentStartPayload' | ||
| - $ref: '#/components/schemas/PaymentSettlementPayload' | ||
| - $ref: '#/components/schemas/PaymentReconciliationPayload' | ||
| max_attempts: { type: integer, minimum: 1, default: 3 } | ||
| type: { type: string, const: PAYMENT_CAPTURE } | ||
| payload: { $ref: '#/components/schemas/PaymentStartPayload' } | ||
|
Comment on lines
303
to
+307
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Com este novo schema, cada variante de Useful? React with 👍 / 👎. |
||
| CreatePaymentDisbursementJob: | ||
| type: object | ||
| additionalProperties: false | ||
| required: [type, payload] | ||
| properties: | ||
| type: { type: string, const: PAYMENT_DISBURSEMENT } | ||
| payload: { $ref: '#/components/schemas/PaymentStartPayload' } | ||
| CreatePaymentSettlementJob: | ||
| type: object | ||
| additionalProperties: false | ||
| required: [type, payload] | ||
| properties: | ||
| type: { type: string, const: PAYMENT_SETTLEMENT } | ||
| payload: { $ref: '#/components/schemas/PaymentSettlementPayload' } | ||
| CreatePaymentReconciliationJob: | ||
| type: object | ||
| additionalProperties: false | ||
| required: [type, payload] | ||
| properties: | ||
| type: { type: string, const: PAYMENT_RECONCILIATION } | ||
| payload: { $ref: '#/components/schemas/PaymentReconciliationPayload' } | ||
| WorkerJob: | ||
| type: object | ||
| required: [id, queue, type, tenant_id, payload, status, attempts, max_attempts, created_at, updated_at] | ||
|
|
@@ -397,12 +422,19 @@ components: | |
| payload: { type: object, additionalProperties: true } | ||
| PlatformStatus: | ||
| type: object | ||
| additionalProperties: false | ||
| required: [status, service, version, environment, started_at, uptime_seconds, dependencies, worker, schedules, queues] | ||
| properties: | ||
| service: { type: string } | ||
| status: { type: string, enum: [ok, degraded, down] } | ||
| timestamp: { type: string, format: date-time } | ||
| version: { type: string } | ||
| environment: { type: string } | ||
| started_at: { type: string, format: date-time } | ||
| uptime_seconds: { type: integer, minimum: 0 } | ||
| worker: { type: object, additionalProperties: true } | ||
| dependencies: { type: object, additionalProperties: true } | ||
| schedules: { type: array, items: { $ref: '#/components/schemas/ScheduledJob' } } | ||
| queues: { type: array, items: { $ref: '#/components/schemas/QueueStats' } } | ||
| HttpError: | ||
| type: object | ||
| required: [statusCode, message] | ||
|
|
@@ -432,3 +464,6 @@ components: | |
| Conflict: | ||
| description: Idempotency key, state, or delivery reference conflicts with existing state | ||
| content: { application/json: { schema: { $ref: '#/components/schemas/HttpError' } } } | ||
| ServiceUnavailable: | ||
| description: Durable receipt storage or queue execution is temporarily unavailable | ||
| content: { application/json: { schema: { $ref: '#/components/schemas/HttpError' } } } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ao adicionar
tenant_idaos schemas deauthorization_code(e também derefresh_token, linhas 231-234), o contrato público passa a aceitar um tenant informado pelo cliente em grants que já devem estar vinculados ao authorization code/refresh token. Em validadores/SDKs gerados a partir deste OpenAPI, isso viola o modelo documentado de tenant derivado da identidade e cria um caminho suportado para tentativas de troca de tenant; mantenha o seletor somente no grant de serviço ou rejeite-o nesses grants.Useful? React with 👍 / 👎.