---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: tokens.hadron.rs
spec:
  group: hadron.rs
  names:
    categories: []
    kind: Token
    plural: tokens
    shortNames:
      - token
    singular: token
  scope: Namespaced
  versions:
    - additionalPrinterColumns:
        - jsonPath: ".spec.all"
          name: All
          type: string
        - jsonPath: ".status.token_id"
          name: Token ID
          type: string
      name: v1beta1
      schema:
        openAPIV3Schema:
          description: "Auto-generated derived type for TokenSpec via `CustomResource`"
          properties:
            spec:
              description: "CRD spec for the Token resource.\n\nTokens are used to establish authentication & authorization controls within a Hadron cluster.\n\nWhen Hadron detects a new Token CR, it will generate a new Kubernetes secret bearing the same name as the respective Token CR. The generated secret will contain a JWT signed by the Hadron cluster's private key."
              properties:
                all:
                  default: false
                  description: "Grant full access to all resources of the cluster.\n\nIf this value is true, then all other values are ignored."
                  type: boolean
                endpoints:
                  description: Permissions granted on RPC endpoints.
                  nullable: true
                  properties:
                    pub:
                      description: Object names for which publishing access is granted.
                      items:
                        type: string
                      type: array
                    sub:
                      description: Object names for which subscription access is granted.
                      items:
                        type: string
                      type: array
                  required:
                    - pub
                    - sub
                  type: object
                exchanges:
                  description: Permissions granted on ephemeral messaging exchanges.
                  nullable: true
                  properties:
                    pub:
                      description: Object names for which publishing access is granted.
                      items:
                        type: string
                      type: array
                    sub:
                      description: Object names for which subscription access is granted.
                      items:
                        type: string
                      type: array
                  required:
                    - pub
                    - sub
                  type: object
                streams:
                  description: Permissions granted on streams.
                  nullable: true
                  properties:
                    pub:
                      description: Object names for which publishing access is granted.
                      items:
                        type: string
                      type: array
                    sub:
                      description: Object names for which subscription access is granted.
                      items:
                        type: string
                      type: array
                  required:
                    - pub
                    - sub
                  type: object
              type: object
            status:
              description: CRD status object.
              nullable: true
              properties:
                tokenId:
                  description: The ID of the created token.
                  type: string
              required:
                - tokenId
              type: object
          required:
            - spec
          title: TokenCRD
          type: object
      served: true
      storage: true
      subresources:
        status: {}
