Commit 7cbc1909 authored by Martin Ward's avatar Martin Ward
Browse files

Update interop-kms.yaml

parent 22249a81
Loading
Loading
Loading
Loading
+61 −71
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ info:
  contact:
    name: ETSI ISG QKD
    email: 'isgsupport@etsi.org'
  version: '0.2.1'
  version: '0.3.1'
  license:
    name: BSD 3-Clause
    url: https://forge.etsi.org/legal-matters
@@ -46,20 +46,16 @@ paths:
        '503':
          $ref: '#/components/responses/503-extkey'

  /kmapi/v1/ext_keys/{initiator_sae_id}/{target_sae_id}:
  /kmapi/v1/ext_keys:
    post:
      summary: 'Transfer keys to external KMS'
      operationId: post-ext_keys
      description: |
        Pass an extended key request container comprising key material and associated data to another KME, for the key(s) to be delivered (by relay where necessary) to the target SAE(s) specified. The extended key request container contains keys matching those to be delivered to the initiator SAE.

        If this method is called without specifying an `ack_callback_url`, it will execute in 'blocking mode', whereby the KME will only respond once the keys have been relayed to the KME corresponding to the `target_sae_id`. If this method is called with an `ack_callback_url` specified, then it will execute in 'non-blocking mode', whereby the KME will respond quickly with an HTTP code 202 ('Accepted'), then it will issue a separate call (or multiple calls) to the `ack_callback_url` endpoint once the keys are actually delivered (or fail to be delivered).
        This method is 'non-blocking'. Upon a valid request, the KME will respond with an HTTP code 202 ('Accepted'), then it will issue a separate call (or multiple calls) to the specified `ack_callback_url` endpoint once the keys are actually delivered (or fail to be delivered).

        When 'non-blocking mode' is requested, the server shall respond with Code 202 if it accepts the request.
        When operating in 'blocking mode', there will be a delay while the remote KMS relays the key(s), then a Code 200 response will be returned. This response includes a status field which may have either the value `success` or `partial_success`. `success` indicates that all keys were delivered to the destination KME. An array of acknowledgement containers may be optionally returned that includes extension fields (which could be, e.g. metadata for each key to indicate its routing information from the remote KMS). If such containers are returned, the extensions should be handled by the requesting KMS (e.g. to keep the provided metadata with each key so it can be relayed to the initiator SAE). If one or more key failed to be relayed successfully the KME shall respond with a value of `partial_success` in the status field and the KME shall return an array of acknowledgement containers that includes the status of each key.
      parameters:
        - $ref: '#/components/parameters/initiator_sae_id'
        - $ref: '#/components/parameters/target_sae_id'
        A Code 400 error will be returned if the container format is invalid or includes initiator/target SAE IDs for which a valid route is not known to the KME.
      requestBody:
        description: 'Extended key request container.'
        required: true
@@ -68,8 +64,6 @@ paths:
            schema:
              $ref: '#/components/schemas/ext_key_container'
      responses:
        '200':
          $ref: '#/components/responses/200-request-response'
        '202':
          $ref: '#/components/responses/202-extkey'
        '400':
@@ -81,17 +75,19 @@ paths:
        '503':
          $ref: '#/components/responses/503-extkey'

  /kmapi/v1/ext_keys/void/{initiator_sae_id}/{target_sae_id}:
  /kmapi/v1/ext_keys/void:
    post:
      summary: 'Signal keys as void to external KMS (i.e. discard keys)'
      operationId: post-ext_keys-void
      description: |
        Pass an extended key request container comprising key IDs to another KME, for the key(s) to be marked as void (i.e. discarded and not delivered to SAEs). The Extended Key Container contains keys matching those already passed to the KME.

        As for `ext_keys`, this method blocks when the `ack_callback_url` field is omitted and operates in non-blocking mode when the `ack_callback_url` field is supplied. If this is called without supplying a `key_ids` array, then all keys shared between the provided SAEs will be voided (to prevent accidental key loss, to confirm this action an `all_confirmation` boolean field must also be passed as true, otherwise a Code 400 error is returned).
        As for `ext_keys`, this method is 'non-blocking'. Upon a valid request, a KME shall discard keys relating to the provided key IDs and post a call to the specified `ack_callback_url` describing the completed operation. Any subsequent 'get key with key ID' requests made to the KME (using ETSI 014) for those keys will be rejected.

        A Code 400 error will be returned if the container format is invalid or includes initiator/target SAE IDs for which a valid route is not known to the KME.

        If this is called without supplying a `key_ids` array, then all keys shared between the provided SAEs will be voided (to prevent accidental key loss, to confirm this action an `all_confirmation` boolean field must also be passed as true, otherwise a Code 400 error is returned).
      parameters:
        - $ref: '#/components/parameters/initiator_sae_id'
        - $ref: '#/components/parameters/target_sae_id'
        - $ref: '#/components/parameters/all_confirmation'
      requestBody:
        description: 'Void request container'
@@ -101,8 +97,6 @@ paths:
            schema:
              $ref: '#/components/schemas/void_container'
      responses:
        '200':
          $ref: '#/components/responses/200-request-response'
        '202':
          $ref: '#/components/responses/202-extkey'
        '400':
@@ -118,7 +112,22 @@ paths:
    post:
      summary: 'Acknowledge completion of a previous ext_key request'
      operationId: post-ext_keys-ack
      description: 'Pass one or more key acknowledgement containers comprising key IDs associated with a previous (non-blocking) call to the ext_keys method to deliver keys by an external KMS. The status of all keys in the container is indicated by the status field.'
      description: |
        Pass one or more key acknowledgement containers comprising key IDs associated with a previous call to the ext_keys method by an external KMS. The status of all keys in the container is indicated by the status field.

        The `status` field may be `relayed` `voided` `failed` or `key not present`.
        - `relayed` indicates the KME has successfully relayed the specified keys to the requested target (where the initiator_sae_id and target_sae_id are specified in the acknowledgement container). If the initiator requested multiple targets, the acknowledgements for each target are separate acknowledgement containers (since the status for each target may be different).
        - `voided` indicates the KME has successfully voided the specified keys so they will not be delivered to applications.
        - `failed` indicates that the requested operation on the specified keys could not be completed. For example, an ext_keys request may not complete if there is insufficient key material for relaying. Also, a void request will fail if the specified keys have already been delivered to a requesting SAE.
        - `key not present` indicates that the specified keys could not be found by the KME.

        In addition to the `status` field, additional information (e.g. explaining a failure) can be included in the optional `message` field.

        It is possible that a single ext_keys request included multiple keys, where some are successfully delivered and other fail. This can be indicated by a KME sending multiple acknowledgement requests, with the container payload used to specify the status of different arrays of keys. A single container should be used for each target SAE ID.

        Extension fields may also be optionally included (which could be, e.g. metadata for each key to indicate its routing information from the remote KMS). If such extensions are included, the extensions should be handled accordingly (e.g. to keep the provided metadata with each key so it can be relayed to the initiator SAE).

        A Code 200 Success will returned by a KME receiving a valid acknowledgement, otherwise an Error Code will be returned including details of the error.
      requestBody:
        description: 'Acknowledgements containers'
        required: true
@@ -138,24 +147,10 @@ paths:

components:
  responses:
    200-request-response:
      description: Request processed response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/request_response'
    200-ack-response:
      description: Successful response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/message_data'
    202-extkey:
      description: Request accepted response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/message_data'
    400-extkey:
      description: Bad request format response
      content:
@@ -222,6 +217,11 @@ components:
                message: 'ack not understood'
                details:
                  - 'ack_not_understood': 'KME cannot parse the submitted acknowledgement.'
            key_not_present:
              value:
                message: 'key not present'
                details:
                  - 'key_not_present': 'The acknowledged key ID(s) are not known to this KME.'
    401-extkey:
      description: Unauthorized response
      content:
@@ -259,11 +259,11 @@ components:
      example: encryptor1
    target_sae_id:
      type: string
      description: ID of target SAE that the initiator SAE wishes to share keys with (single target only; for sharing to multiple targets, specify additional_target_sae_ids in body).
      description: ID of target SAE that the initiator SAE wishes to share keys with.
      example: encryptor2
    additional_target_sae_ids:
    target_sae_ids:
      type: array
      description: Array of IDs of target SAEs. It is used for specifying two or more target SAEs to share identical keys. The maximum number of IDs is defined as max_sae_id_count in Status data format.
      description: Array of IDs of target SAEs relevant to the request. (In a call to ext_keys to request keys to be shared these are the keys the initiator SAE wishes to share keys with.) A single target or multiple targets can be specified (where each target gets an identical key). The maximum number of IDs is defined as `max_sae_id_count` in Status data format.
      items:
        $ref: '#/components/schemas/target_sae_id'
    key_id:
@@ -294,7 +294,7 @@ components:
      example:
        - 'abc_max_age': 30000
    ack_callback_url:
      description: 'URL to which acknowledgement should be sent after relaying to the KME(s) associated with target SAE(s) (for ‘non-blocking’ operation) completes or fails.'
      description: 'URL to which acknowledgement(s) should be sent after all or part of the request completes or fails.'
      type: string
      example: https://kme1/kmapi/v1/ext_keys/ack
    ack_status:
@@ -323,11 +323,16 @@ components:
      type: object
      required:
      - keys
      - initiator_sae_id
      - target_sae_ids
      - ack_callback_url
      properties:
        keys:
          $ref: '#/components/schemas/keys'
        additional_target_sae_ids:
          $ref: '#/components/schemas/additional_target_sae_ids'
        initiator_sae_id:
          $ref: '#/components/schemas/initiator_sae_id'
        target_sae_ids:
          $ref: '#/components/schemas/target_sae_ids'
        ack_callback_url:
          $ref: '#/components/schemas/ack_callback_url'
        extension_mandatory:
@@ -357,11 +362,18 @@ components:
    void_container:
      title: 'Void request container'
      type: object
      required:
        - key_ids
        - initiator_sae_id
        - target_sae_ids
        - ack_callback_url
      properties:
        key_ids:
          $ref: '#/components/schemas/key_ids'
        additional_target_sae_ids:
          $ref: '#/components/schemas/additional_target_sae_ids'
        initiator_sae_id:
          $ref: '#/components/schemas/initiator_sae_id'
        target_sae_ids:
          $ref: '#/components/schemas/target_sae_ids'
        ack_callback_url:
          $ref: '#/components/schemas/ack_callback_url'
        extension:
@@ -384,6 +396,8 @@ components:
          $ref: '#/components/schemas/initiator_sae_id'
        target_sae_id:
          $ref: '#/components/schemas/target_sae_id'
        message:
          $ref: '#/components/schemas/ack_message'
        extension:
          $ref: '#/components/schemas/extension'

@@ -396,9 +410,7 @@ components:
    version:
      type: string
      description: 'Supported API version.'
      example:
        - 'v1'
        - 'v2'
      example: 'v1'
    versions:
      type: array
      description: 'Array of supported API versions.'
@@ -415,6 +427,12 @@ components:
        extension:
          $ref: '#/components/schemas/extension'

    ack_message:
      title: 'message'
      description: Optional further details to expand upon the `ack_status`.
      type: string


    message_data:
      title: 'Message data format'
      type: object
@@ -431,36 +449,8 @@ components:
          items:
            type: object

    request_response:
      title: 'Request response'
      type: object
      required:
      - status
      properties:
        status:
          description: Status of request
          type: string
          enum: [success, partial_success]
          example: success
        ack_containers:
            $ref: '#/components/schemas/ack_containers'

  parameters:

    initiator_sae_id:
      name: initiator_sae_id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/initiator_sae_id'

    target_sae_id:
      name: target_sae_id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/target_sae_id'

    all_confirmation:
      name: all_confirmation
      in: query