name: OAuth2Clients
icon: entity
label: OAuth2 Client
hidden: true
enable_search: false
fields:
  clientName:
    type: text
    label: Name
    is_name: true
    required: true
    searchable: true
  active:
    type: boolean
    label: Active
    defaultValue: true
  expires:
    type: number
    label: Term of Validity（HOUR）
    defaultValue: '1'
  redirectUri:
    type: text
    label: Callback URL
    is_wide: true
    required: true
  clientId:
    type: text
    label: Client ID
    is_wide: true
    defaultValue: !<tag:yaml.org,2002:js/function> |-
      function () {
              return Random.id();
            }
  clientSecret:
    type: text
    label: Secret
    is_wide: true
    defaultValue: !<tag:yaml.org,2002:js/function> |-
      function () {
              return Random.secret();
            }
list_views:
  all:
    label: All OAuth2 Clients
    columns:
      - clientName
      - active
      - redirectUri
permission_set:
  user:
    allowCreate: false
    allowDelete: false
    allowEdit: false
    allowRead: false
    modifyAllRecords: false
    viewAllRecords: false
  admin:
    allowCreate: true
    allowDelete: true
    allowEdit: true
    allowRead: true
    modifyAllRecords: true
    viewAllRecords: true
