post:
  operationId: createPasswordPolicy
  tags:
    - Password Policies
  summary: Create Password Policy
  description: >-
    This API creates the specified password policy.
    A token with ORG_ADMIN authority is required to call this API.
  #  security:
  #   - oauth2: [ORG_ADMIN]
  requestBody:
    required: true
    content:
      application/json:
        schema:
          $ref: '../schemas/PasswordPolicyV3Dto.yaml'
        example:
          {
            "description": "New Password Policy with high requirements to password complexity.",
            "id": null,
            "name": "High security Password Policy",
            "dateCreated": 1639056206564,
            "lastUpdated": 1662385430753,
            "firstExpirationReminder": 90,
            "accountIdMinWordLength": 3,
            "accountNameMinWordLength": 3,
            "maxLength": 0,
            "maxRepeatedChars": 4,
            "minAlpha": 1,
            "minCharacterTypes": -1,
            "minLength": 8,
            "minLower": 0,
            "minNumeric": 1,
            "minSpecial": 0,
            "minUpper": 0,
            "passwordExpiration": 90,
            "defaultPolicy": false,
            "enablePasswdExpiration": false,
            "requireStrongAuthn": false,
            "requireStrongAuthOffNetwork": false,
            "requireStrongAuthUntrustedGeographies": false,
            "useAccountAttributes": false,
            "useDictionary": false,
            "useIdentityAttributes": false,
            "validateAgainstAccountId": true,
            "validateAgainstAccountName": true,
            "sourceIds": ["2c91808382ffee0b01830de154f14034","2c91808582ffee0c01830de36511405f" ]
          }
  responses:
    '200':
      description: Reference to the password policy.
      content:
        application/json:
          schema:
            $ref: '../schemas/PasswordPolicyV3Dto.yaml'
    '400':
      $ref: '../../v3/responses/400.yaml'
    '401':
      $ref: '../../v3/responses/401.yaml'
    '403':
      $ref: '../../v3/responses/403.yaml'
    '404':
      $ref: '../../v3/responses/404.yaml'
    '429':
      $ref: '../../v3/responses/429.yaml'
    '500':
      $ref: '../../v3/responses/500.yaml'
get:
  operationId: listPasswordPolicies
  tags:
    - Password Policies
  summary: List Password Policies
  # security:
  #   - oauth2: [ORG_ADMIN]
  description: >-
    This gets list of all Password Policies.

    Requires role of ORG_ADMIN
  parameters:
    - $ref: '../../v3/parameters/limit.yaml'
    - $ref: '../../v3/parameters/offset.yaml'
    - $ref: '../../v3/parameters/count.yaml'
  responses:
    '200':
      description: List of all Password Policies.
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '../schemas/PasswordPolicyV3Dto.yaml'
          example:
            [
              {
                "description": "Example Password Policy",
                "id": "2c91808e7d976f3b017d9f5ceae440c8",
                "name": "Example PP",
                "dateCreated": 1639056206564,
                "lastUpdated": 1662385430753,
                "firstExpirationReminder": 90,
                "accountIdMinWordLength": 3,
                "accountNameMinWordLength": 3,
                "maxLength": 0,
                "maxRepeatedChars": 4,
                "minAlpha": 1,
                "minCharacterTypes": -1,
                "minLength": 8,
                "minLower": 0,
                "minNumeric": 1,
                "minSpecial": 0,
                "minUpper": 0,
                "passwordExpiration": 90,
                "defaultPolicy": false,
                "enablePasswdExpiration": false,
                "requireStrongAuthn": false,
                "requireStrongAuthOffNetwork": false,
                "requireStrongAuthUntrustedGeographies": false,
                "useAccountAttributes": false,
                "useDictionary": false,
                "useIdentityAttributes": false,
                "validateAgainstAccountId": true,
                "validateAgainstAccountName": true,
                "sourceIds": ["2c91808382ffee0b01830de154f14034","2c91808582ffee0c01830de36511405f" ]
              },
              {
                "description": null,
                "id": "2c91808780b8b8430180ff7a093f3bf2",
                "name": "Password Policy 1 test",
                "dateCreated": 1653553629503,
                "lastUpdated": null,
                "firstExpirationReminder": null,
                "accountIdMinWordLength": -1,
                "accountNameMinWordLength": -1,
                "maxLength": 0,
                "maxRepeatedChars": -1,
                "minAlpha": 1,
                "minCharacterTypes": -1,
                "minLength": 8,
                "minLower": 0,
                "minNumeric": 1,
                "minSpecial": 0,
                "minUpper": 0,
                "passwordExpiration": 90,
                "defaultPolicy": false,
                "enablePasswdExpiration": false,
                "requireStrongAuthn": false,
                "requireStrongAuthOffNetwork": false,
                "requireStrongAuthUntrustedGeographies": false,
                "useAccountAttributes": false,
                "useDictionary": false,
                "useIdentityAttributes": true,
                "validateAgainstAccountId": false,
                "validateAgainstAccountName": false,
                "sourceIds": [ ]
              }
            ]
    '400':
      $ref: '../../v3/responses/400.yaml'
    '401':
      $ref: '../../v3/responses/401.yaml'
    '403':
      $ref: '../../v3/responses/403.yaml'
    '429':
      $ref: '../../v3/responses/429.yaml'
    '500':
      $ref: '../../v3/responses/500.yaml'
