github.com/thetreep/go-swagger@v0.0.0-20240223100711-35af64f14f01/fixtures/bugs/2919/edge-api/management/enrollments.yml (about)

     1  ---
     2  paths:
     3    enrollments:
     4      get:
     5        summary: List outstanding enrollments
     6        description: |
     7          Retrieves a list of outstanding enrollments; supports filtering, sorting, and pagination. Requires admin access.
     8        security:
     9          - ztSession: [ ]
    10        tags:
    11          - Enrollment
    12        operationId: listEnrollments
    13        parameters:
    14          - $ref: '../shared/parameters.yml#/limit'
    15          - $ref: '../shared/parameters.yml#/offset'
    16          - $ref: '../shared/parameters.yml#/filter'
    17        responses:
    18          '200':
    19            $ref: '#/responses/listEnrollments'
    20          '401':
    21            $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse'
    22          '400':
    23            $ref: '../shared/standard-responses.yml#/responses/badRequestResponse'
    24      post:
    25        summary: Create an outstanding enrollment for an identity
    26        description: >-
    27          Creates a new OTT, OTTCA, or UPDB enrollment for a specific identity. If an enrollment of the same type
    28          is already outstanding the request will fail with a 409 conflict. If desired, an existing enrollment
    29          can be refreshed by `enrollments/:id/refresh` or deleted.
    30        security:
    31          - ztSession: [ ]
    32        tags:
    33          - Enrollment
    34        operationId: createEnrollment
    35        parameters:
    36          - name: enrollment
    37            in: body
    38            required: true
    39            description: An enrollment to create
    40            schema:
    41              $ref: '#/definitions/enrollmentCreate'
    42        responses:
    43          '201':
    44            $ref: '../shared/standard-responses.yml#/responses/createResponse'
    45          '400':
    46            $ref: '../shared/standard-responses.yml#/responses/badRequestResponse'
    47          '401':
    48            $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse'
    49          '409':
    50            $ref: '../shared/standard-responses.yml#/responses/conflictResponse'
    51    enrollments-id:
    52      parameters:
    53        - $ref: '../shared/parameters.yml#/id'
    54      get:
    55        summary: Retrieves an outstanding enrollment
    56        description: Retrieves a single outstanding enrollment by id. Requires admin access.
    57        security:
    58          - ztSession: [ ]
    59        tags:
    60          - Enrollment
    61        operationId: detailEnrollment
    62        responses:
    63          '200':
    64            $ref: '#/responses/detailEnrollment'
    65          '404':
    66            $ref: '../shared/standard-responses.yml#/responses/notFoundResponse'
    67          '401':
    68            $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse'
    69      delete:
    70        summary: Delete an outstanding enrollment
    71        description: Delete an outstanding enrollment by id. Requires admin access.
    72        security:
    73          - ztSession: [ ]
    74        tags:
    75          - Enrollment
    76        operationId: deleteEnrollment
    77        responses:
    78          '200':
    79            $ref: '../shared/standard-responses.yml#/responses/deleteResponse'
    80          '400':
    81            $ref: '../shared/standard-responses.yml#/responses/badRequestResponse'
    82          '401':
    83            $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse'
    84    enrollments-id-refresh:
    85      parameters:
    86        - $ref: '../shared/parameters.yml#/id'
    87      post:
    88        summary: Refreshes an enrollment record's expiration window
    89        description: >-
    90            For expired or unexpired enrollments, reset the expiration window. A new JWT will be generated
    91            and must be used for the enrollment.
    92        security:
    93          - ztSession: [ ]
    94        tags:
    95          - Enrollment
    96        operationId: refreshEnrollment
    97        parameters:
    98          - name: refresh
    99            in: body
   100            required: true
   101            description: An enrollment refresh request
   102            schema:
   103              $ref: '#/definitions/enrollmentRefresh'
   104        responses:
   105          '200':
   106            $ref: '../shared/standard-responses.yml#/responses/createResponse'
   107          '400':
   108            $ref: '../shared/standard-responses.yml#/responses/badRequestResponse'
   109          '401':
   110            $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse'
   111  responses:
   112    listEnrollments:
   113      description: A list of enrollments
   114      schema:
   115        $ref: '#/definitions/listEnrollmentsEnvelope'
   116    detailEnrollment:
   117      description: A singular enrollment resource
   118      schema:
   119        $ref: '#/definitions/detailEnrollmentEnvelope'
   120  
   121  definitions:
   122    listEnrollmentsEnvelope:
   123      type: object
   124      required:
   125        - meta
   126        - data
   127      properties:
   128        meta:
   129          $ref: '../shared/standard-responses.yml#/definitions/meta'
   130        data:
   131          $ref: '#/definitions/enrollmentList'
   132    detailEnrollmentEnvelope:
   133      type: object
   134      required:
   135        - meta
   136        - data
   137      properties:
   138        meta:
   139          $ref: '../shared/standard-responses.yml#/definitions/meta'
   140        data:
   141          $ref: '#/definitions/enrollmentDetail'
   142    enrollmentList:
   143      description: An array of enrollment resources
   144      type: array
   145      items:
   146        $ref: '#/definitions/enrollmentDetail'
   147    enrollmentDetail:
   148      type: object
   149      description: |
   150        An enrollment object. Enrollments are tied to identities and potentially a CA. Depending on the
   151        method, different fields are utilized. For example ottca enrollments use the `ca` field and updb enrollments
   152        use the username field, but not vice versa.
   153      allOf:
   154        - $ref: '../shared/base-entity.yml#/definitions/baseEntity'
   155        - type: object
   156          required:
   157            - token
   158            - method
   159            - expiresAt
   160            - details
   161          properties:
   162            token:
   163              type: string
   164            method:
   165              type: string
   166            expiresAt:
   167              type: string
   168              format: date-time
   169            identityId:
   170              type: string
   171            caId:
   172              type: string
   173              x-nullable: true
   174            identity:
   175              $ref: '../shared/base-entity.yml#/definitions/entityRef'
   176            edgeRouterId:
   177              type: string
   178            edgeRouter:
   179              $ref: '../shared/base-entity.yml#/definitions/entityRef'
   180            transitRouterId:
   181              type: string
   182            transitRouter:
   183              $ref: '../shared/base-entity.yml#/definitions/entityRef'
   184            username:
   185              type: string
   186            jwt:
   187              type: string
   188      example:
   189        id: 624fa53f-7629-4a7a-9e38-c1f4ce322c1d
   190        createdAt: '0001-01-01T00:00:00Z'
   191        updatedAt: '0001-01-01T00:00:00Z'
   192        _links:
   193          self:
   194            href: './enrollments/624fa53f-7629-4a7a-9e38-c1f4ce322c1d'
   195        tags:
   196        token: 1e727c8f-07e4-4a1d-a8b0-da0c7a01c6e1
   197        method: updb
   198        expiresAt: '2020-03-11T20:20:24.0055543Z'
   199        identity:
   200          urlName: identities
   201          id: f047ac96-dc3a-408a-a6f2-0ba487c08ef9
   202          name: updb--0f245140-7f2e-4326-badf-6aba55e52475
   203          _links:
   204            self:
   205              href: './identities/f047ac96-dc3a-408a-a6f2-0ba487c08ef9'
   206        ca:
   207        username: example-username
   208    enrollmentCreate:
   209      type: object
   210      required:
   211        - method
   212        - expiresAt
   213        - identityId
   214      properties:
   215        method:
   216          type: string
   217          enum:
   218            - ott
   219            - ottca
   220            - updb
   221        expiresAt:
   222          type: string
   223          format: date-time
   224        identityId:
   225          type: string
   226        caId:
   227          type: string
   228          x-nullable: true
   229        username:
   230          type: string
   231          x-nullable: true
   232    enrollmentRefresh:
   233      type: object
   234      required:
   235        - expiresAt
   236      properties:
   237        expiresAt:
   238          type: string
   239          format: date-time