openapi: 3.1.1
info:
  title: 'Verification Server Internal API'
  description:
    The API for the verification_server's internal endpoint. Optionally
    authenticated, intended to be accessible only to the relying party's
    application. It is used for session initiation and disclosed attribute
    retrieval.
  version: 0.6.0-dev

components:
  securitySchemes:
    bearer_token:
      description: Bearer token authentication
      scheme: bearer
      type: http

security:
  - {}
  - bearer_token: []

servers:
  - url: '{scheme}://{rp_rs_host}:{rp_rs_port}'
    variables:
      scheme:
        enum:
          - http
          - https
        default: http
      rp_rs_host:
        enum:
          - localhost
          - demo
        default: localhost
      rp_rs_port:
        default: '8002'

paths:
  /disclosure/sessions:
    post:
      summary: Initialize a new session
      requestBody:
        content:
          application/json:
            schema:
              $ref: 'verification-server-components.openapi.yaml#/components/schemas/SessionRequest'
      responses:
        '200':
          description: Session created
          content:
            application/json:
              schema:
                $ref: 'verification-server-components.openapi.yaml#/components/schemas/SessionResponse'

  /disclosure/sessions/{session_token}/disclosed_attributes:
    parameters:
      - $ref: 'verification-server-components.openapi.yaml#/components/parameters/session_token'
      - $ref: 'verification-server-components.openapi.yaml#/components/parameters/nonce'
    get:
      summary: Retrieve disclosed attributes
      responses:
        '200':
          description: Disclosed attributes
          content:
            application/json:
              schema:
                $ref: 'verification-server-components.openapi.yaml#/components/schemas/DisclosedAttestations'
        '400':
          description: Session is not in the required state
          content:
            application/json:
              schema:
                $ref: 'verification-server-components.openapi.yaml#/components/schemas/ErrorMessage'
        '404':
          description: Unknown session
          content:
            application/json:
              schema:
                $ref: 'verification-server-components.openapi.yaml#/components/schemas/ErrorMessage'
