110 lines
4.1 KiB
YAML
110 lines
4.1 KiB
YAML
# AIOS Task Admission Bootstrap OpenAPI fragment.
|
|
# Integrate into the canonical Bridge OpenAPI only when the corresponding live
|
|
# handlers and authorization backend are configured. This fragment does not
|
|
# enable legacy repository mutation or change TaskPrincipal/WriterLease gates.
|
|
|
|
components:
|
|
schemas:
|
|
TaskAdmissionEnvelopeRequest:
|
|
type: object
|
|
additionalProperties: false
|
|
required:
|
|
- idempotency_key
|
|
- task_id
|
|
- repository
|
|
- authority_base_oid
|
|
- target_branch
|
|
- generation
|
|
- execution_digest
|
|
- requested_capabilities
|
|
- file_allowlist
|
|
- risk
|
|
properties:
|
|
idempotency_key: {type: string, minLength: 8, maxLength: 256}
|
|
task_id: {type: string, minLength: 3, maxLength: 180}
|
|
repository: {type: string, enum: [aios/aios]}
|
|
authority_base_oid: {type: string, pattern: '^[0-9a-f]{40}$'}
|
|
target_branch: {type: string, pattern: '^agent/.+'}
|
|
generation: {type: integer, minimum: 1}
|
|
execution_digest: {type: string, pattern: '^[0-9a-f]{64}$'}
|
|
requested_capabilities:
|
|
type: array
|
|
minItems: 1
|
|
uniqueItems: true
|
|
items: {type: string}
|
|
file_allowlist:
|
|
type: array
|
|
minItems: 1
|
|
uniqueItems: true
|
|
items: {type: string}
|
|
risk: {type: string, enum: [low, medium]}
|
|
expires_in_seconds:
|
|
type: integer
|
|
minimum: 60
|
|
maximum: 900
|
|
|
|
TaskAdmissionAuthorizationRequest:
|
|
type: object
|
|
additionalProperties: false
|
|
required: [envelope_id, authorization_kind]
|
|
properties:
|
|
envelope_id: {type: string}
|
|
authorization_kind:
|
|
type: string
|
|
enum: [delegation_epoch, owner_signature]
|
|
delegation_epoch_id: {type: string}
|
|
owner_key_id: {type: string}
|
|
signature_base64: {type: string}
|
|
|
|
paths:
|
|
/v2/task-admission/envelope:
|
|
post:
|
|
operationId: getTaskAdmissionEnvelope
|
|
summary: Build and persist a canonical narrow Task admission envelope
|
|
description: >
|
|
No Git/Task mutation occurs. The server normalizes repository, branch,
|
|
capabilities, file allowlist, risk, policy digest, expiry and nonce.
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema: {$ref: '#/components/schemas/TaskAdmissionEnvelopeRequest'}
|
|
responses:
|
|
'200': {description: Canonical envelope and signing payload}
|
|
'403': {description: Requested scope exceeds bootstrap policy}
|
|
'409': {description: Idempotency key conflicts with a different request}
|
|
|
|
/v2/task-admission/authorize:
|
|
post:
|
|
operationId: submitTaskAdmissionAuthorization
|
|
summary: Verify durable delegation or Owner signature and admit one exact Task
|
|
description: >
|
|
This operation does not accept a general-purpose bearer as authority.
|
|
Authorization is proven by a verified OwnerDelegationEpoch or by the
|
|
Owner signature over the exact canonical envelope. The resulting grant
|
|
can only narrow scope and is handed to the existing Agent Task API.
|
|
A delegation identifier in caller JSON is insufficient: the backend
|
|
binds the verified parent epoch to the authenticated service caller.
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema: {$ref: '#/components/schemas/TaskAdmissionAuthorizationRequest'}
|
|
responses:
|
|
'200': {description: Exact QUEUED, CLAIMED, or RUNNING Task receipt or idempotent replay}
|
|
'403': {description: Invalid, expired, revoked or widened authorization}
|
|
'409': {description: Conflicting idempotent admission}
|
|
|
|
/v2/task-admission/status:
|
|
get:
|
|
operationId: getTaskAdmissionStatus
|
|
summary: Read durable Task-admission state
|
|
parameters:
|
|
- in: query
|
|
name: envelope_id
|
|
required: true
|
|
schema: {type: string}
|
|
responses:
|
|
'200': {description: Pending or admitted receipt}
|
|
'404': {description: Envelope not found}
|