Opal Security access-rules API

Operations related to access rules

OpenAPI Specification

opal-security-access-rules-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  contact:
    email: hello@opal.dev
    name: Opal Team
    url: https://www.opal.dev/
  description: The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically.
  title: Opal access-rules API
  version: '1.0'
servers:
- description: Production
  url: https://api.opal.dev/v1
tags:
- name: access-rules
  description: Operations related to access rules
paths:
  /access-rules:
    get:
      description: Returns a list of access rules for your organization.
      operationId: get_access_rules
      parameters:
      - description: The pagination cursor value.
        example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw
        explode: true
        in: query
        name: cursor
        required: false
        schema:
          type: string
        style: form
      - description: Number of results to return per page. Default is 200.
        example: 200
        explode: true
        in: query
        name: page_size
        required: false
        schema:
          type: integer
        style: form
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAccessRulesList'
          description: One page of access rules for your organization.
      security:
      - BearerAuth: []
      tags:
      - access-rules
    post:
      description: Creates a new access rule config for the given group_id.
      operationId: create_access_rule
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAccessRuleInfo'
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessRule'
          description: The created access rule config for the group.
      security:
      - BearerAuth: []
      tags:
      - access-rules
  /access-rules/{access_rule_id}:
    get:
      description: Returns a list of access rule config given the group_id of the access rule.
      operationId: get_access_rule
      parameters:
      - description: The access rule ID (group ID) of the access rule.
        example: 1b978423-db0a-4037-a4cf-f79c60cb67b3
        explode: false
        in: path
        name: access_rule_id
        required: true
        schema:
          format: uuid
          type: string
        style: simple
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessRule'
          description: The access rules for the group.
      security:
      - BearerAuth: []
      tags:
      - access-rules
    put:
      description: Updates the access rule config for the given group_id.
      operationId: update_access_rule
      parameters:
      - description: The access rule ID (group ID) of the access rule.
        example: 1b978423-db0a-4037-a4cf-f79c60cb67b3
        explode: false
        in: path
        name: access_rule_id
        required: true
        schema:
          format: uuid
          type: string
        style: simple
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAccessRuleInfo'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessRule'
          description: The updated access rule config for the group.
      security:
      - BearerAuth: []
      tags:
      - access-rules
components:
  schemas:
    RuleDisjunction:
      properties:
        selectors:
          type: array
          items:
            $ref: '#/components/schemas/TagSelector'
        attribute_selectors:
          type: array
          items:
            $ref: '#/components/schemas/UserAttributeSelector'
      required:
      - selectors
    RuleConjunction:
      properties:
        clauses:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/RuleDisjunction'
      required:
      - clauses
    AccessRule:
      description: '# Access Rule Object

        ### Description

        The `AccessRule` object is used to represent an access rule configuration.


        ### Usage Example

        List access rules from the `GET /access-rules` endpoint, or retrieve a single access rule from the `GET /access-rules/{access_rule_id}` endpoint.'
      properties:
        access_rule_id:
          description: The ID (group ID) of the access rule.
          example: 7c86c85d-0651-43e2-a748-d69d658418e8
          format: uuid
          type: string
        name:
          description: The name of the access rule.
          example: Platform Engineering
          type: string
        description:
          description: A description of the group.
          example: This access rule represents all platform engineers in the company.
          type: string
        admin_owner_id:
          description: The ID of the owner of the group.
          example: 7c86c85d-0651-43e2-a748-d69d658418e8
          format: uuid
          type: string
        status:
          description: The status of the access rule.
          type: string
          enum:
          - ACTIVE
          - PAUSED
          example: ACTIVE
        ruleClauses:
          $ref: '#/components/schemas/RuleClauses'
      required:
      - status
      - ruleClauses
      - name
      - admin_owner_id
      - access_rule_id
      - description
    UpdateAccessRuleInfo:
      description: '# UpdateAccessRuleInfo Object

        ### Description

        The `UpdateAccessRuleInfo` object is used as an input to the UpdateAccessRule and CreateAccessRule API.'
      properties:
        name:
          description: The name of the access rule.
          example: Platform Engineering
          type: string
        description:
          description: A description of the group.
          example: This access rule represents all platform engineers in the company.
          type: string
        admin_owner_id:
          description: The ID of the owner of the group.
          example: 7c86c85d-0651-43e2-a748-d69d658418e8
          format: uuid
          type: string
        status:
          description: The status of the access rule.
          type: string
          enum:
          - ACTIVE
          - PAUSED
          example: ACTIVE
        ruleClauses:
          $ref: '#/components/schemas/RuleClauses'
      required:
      - status
      - ruleClauses
      - name
      - admin_owner_id
      - description
    RuleClauses:
      properties:
        when:
          $ref: '#/components/schemas/RuleConjunction'
        unless:
          $ref: '#/components/schemas/RuleConjunction'
      required:
      - when
    TagSelector:
      properties:
        key:
          type: string
        value:
          type: string
        connection_id:
          type: string
          format: uuid
      required:
      - key
      - value
      - connection_id
    PaginatedAccessRulesList:
      properties:
        next:
          description: The cursor with which to continue pagination if additional result pages exist.
          example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw
          type: string
        previous:
          description: The cursor used to retrieve the previous page of results.
          example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ
          type: string
        results:
          items:
            $ref: '#/components/schemas/AccessRule'
          type: array
      required:
      - results
      type: object
    UserAttributeSelector:
      properties:
        attribute:
          type: string
          enum:
          - HR_IDP_STATUS
        values:
          type: array
          items:
            type: string
      required:
      - attribute
      - values
  securitySchemes:
    BearerAuth:
      scheme: bearer
      type: http