Secret#

pydantic model phalanx.models.secrets.Secret#

Specification for an application secret for a specific environment.

The same as SecretConfig except augmented with the secret application and key for internal convenience.

Parameters:

data (Any) –

Show JSON schema
{
   "title": "Secret",
   "description": "Specification for an application secret for a specific environment.\n\nThe same as `SecretConfig` except augmented with the secret application\nand key for internal convenience.",
   "type": "object",
   "properties": {
      "description": {
         "title": "Description",
         "type": "string"
      },
      "copy": {
         "title": "Copy",
         "description": "Rules for where the secret should be copied from",
         "allOf": [
            {
               "$ref": "#/definitions/SecretCopyRules"
            }
         ]
      },
      "generate": {
         "title": "Generate",
         "anyOf": [
            {
               "$ref": "#/definitions/SimpleSecretGenerateRules"
            },
            {
               "$ref": "#/definitions/SourceSecretGenerateRules"
            }
         ]
      },
      "value": {
         "title": "Value",
         "type": "string",
         "writeOnly": true,
         "format": "password"
      },
      "key": {
         "title": "Key",
         "type": "string"
      },
      "application": {
         "title": "Application",
         "type": "string"
      }
   },
   "required": [
      "description",
      "key",
      "application"
   ],
   "additionalProperties": false,
   "definitions": {
      "SecretCopyRules": {
         "title": "SecretCopyRules",
         "description": "Rules for copying a secret value from another secret.",
         "type": "object",
         "properties": {
            "application": {
               "title": "Application",
               "type": "string"
            },
            "key": {
               "title": "Key",
               "type": "string"
            }
         },
         "required": [
            "application",
            "key"
         ],
         "additionalProperties": false
      },
      "SimpleSecretGenerateRules": {
         "title": "SimpleSecretGenerateRules",
         "description": "Rules for generating a secret value with no source information.",
         "type": "object",
         "properties": {
            "type": {
               "title": "Type",
               "enum": [
                  "password",
                  "gafaelfawr-token",
                  "fernet-key",
                  "rsa-private-key"
               ],
               "type": "string"
            }
         },
         "required": [
            "type"
         ],
         "additionalProperties": false
      },
      "SourceSecretGenerateRules": {
         "title": "SourceSecretGenerateRules",
         "description": "Rules for generating a secret from another secret.",
         "type": "object",
         "properties": {
            "type": {
               "title": "Type",
               "enum": [
                  "bcrypt-password-hash",
                  "mtime"
               ],
               "type": "string"
            },
            "source": {
               "title": "Source",
               "type": "string"
            }
         },
         "required": [
            "type",
            "source"
         ]
      }
   }
}

Config:
  • allow_population_by_field_name: bool = True

  • extra: Extra = Extra.forbid

Fields:
field application: str [Required]#

Application of the secret.

field copy_rules: Optional[SecretCopyRules] = None (alias 'copy')#

Rules for where the secret should be copied from

field description: str [Required]#

Description of the secret.

field generate: UnionType[SimpleSecretGenerateRules, SourceSecretGenerateRules, None] = None#

Rules for how the secret should be generated.

field key: str [Required]#

Key of the secret.

field value: Optional[SecretStr] = None#

Secret value.

Constraints:
  • type = string

  • writeOnly = True

  • format = password