Phalanx internal API#
These pages document the Phalanx internal API, which may be of interest when extending the Phalanx command-line tool or documentation build infrastructure.
Phalanx does not provide a library or Python module for external use. This API is only intended for use within the Phalanx code itself.
phalanx Package#
Support tooling for Phalanx, SQuaRE’s application development platform.
Variables#
The version string, although |
phalanx.constants Module#
Constants for the Phalanx support code.
Things that arguably could be configurable but haven’t yet been made into actual configuration options.
Variables#
Annotation in |
|
Warning to add to secrets that must be encoded in 1Password. |
|
Description to put in the static secrets YAML file for |
|
Template for a |
|
Default lifetime to set for Vault write tokens. |
|
Remaining lifetime at which to warn that a token is about to expire. |
phalanx.docs.crossref Module#
Cross-referencing roles and directives for Phalanx topics.
Functions#
|
Set up the Phalan cross-referencing extensions. |
phalanx.docs.jinja Module#
Helper functions for Sphinx Jinja templating.
Functions#
Construct the Jinja contexts used for building Phalanx documentation. |
phalanx.exceptions Module#
Exceptions for the Phalanx command-line tool.
Classes#
|
Application being created already exists. |
|
A Helm command failed. |
|
Configuration for an application is invalid. |
|
Configuration for an environment is invalid. |
|
Secret configuration is invalid. |
1Password is configured, but no credentials were supplied. |
|
|
No configuration found for an environment name. |
|
Some secrets could not be resolved. |
|
Secret could not be found in Vault. |
Class Inheritance Diagram#
phalanx.factory Module#
Factory for Phalanx support code components.
Classes#
|
Factory to create Phalanx components. |
Class Inheritance Diagram#
phalanx.models.applications Module#
Pydantic models for Phalanx applications.
Classes#
A Phalanx application that knows which environments use it. |
|
Configuration for a Phalanx application. |
|
A Phalanx application as configured for a specific environment. |
|
A documentation link for an application. |
Class Inheritance Diagram#
phalanx.models.environments Module#
Pydantic models for Phalanx environments.
Classes#
A Phalanx environment and its associated settings. |
|
Configuration common to EnviromentConfig and Environment. |
|
Configuration for a Phalanx environment. |
|
Full details about an environment, including auth and Argo CD. |
|
A group based on a GitHub team. |
|
Designates a GitHub team for use as a Gafaelfawr group. |
|
A Gafaelfawr scope and its associated groups. |
|
|
Type of identity provider used by Gafaelfawr. |
Configuration for 1Password static secrets source. |
|
Root container for the entire Phalanx configuration. |
Class Inheritance Diagram#
phalanx.models.gafaelfawr Module#
Models for Gafaelfawr data structures.
Ideally, these should use the same models Gafaelfawr itself uses. Until that’s possible via a PyPI library, these models are largely copied from Gafaelfawr.
Classes#
An opaque token. |
Class Inheritance Diagram#
phalanx.models.helm Module#
Models for Helm commands.
Classes#
|
A Helm chart starter. |
Class Inheritance Diagram#
phalanx.models.secrets Module#
Pydantic models for Phalanx application secrets.
Classes#
Mix-in class for elements that may have a condition. |
|
Possibly conditional specification for an application secret. |
|
Possibly conditional rules for copying a secret value from another. |
|
Conditional rules for generating a secret value with no source. |
|
Conditional rules for generating a secret from another secret. |
|
Specification for a Docker pull secret. |
|
Pull secret for a specific Docker Repository. |
|
All resolved secrets for a given Phalanx environment. |
|
Specification for an application secret for a specific environment. |
|
Specification for an application secret. |
|
Rules for copying a secret value from another secret. |
|
|
Type of secret for generated secrets. |
Configuration for how a static secret is stored in 1Password. |
|
Rules for generating a secret value with no source information. |
|
Rules for generating a secret from another secret. |
|
Value of a static secret provided in a YAML file. |
|
Model for the YAML file containing static secrets. |
Variables#
Represent a PEP 604 union type |
|
Represent a PEP 604 union type |
Class Inheritance Diagram#
phalanx.models.vault Module#
Models representing Vault objects.
Classes#
Newly-created Vault AppRole for secret access. |
|
Metadata about a new or existing Vault AppRole. |
|
Newly-created Vault token for secret access. |
|
Metadata about a new or existing Vault token. |
Class Inheritance Diagram#
phalanx.services.application Module#
Service for manipulating Phalanx applications.
Classes#
|
Service for manipulating Phalanx applications. |
Class Inheritance Diagram#
phalanx.services.secrets Module#
Service to manipulate Phalanx secrets.
Classes#
|
Results of auditing secrets against the contents of Vault. |
|
Service to manipulate Phalanx secrets. |
Class Inheritance Diagram#
phalanx.services.vault Module#
Service to manage Vault authentication.
Classes#
|
Service to manage Vault authentication. |
Class Inheritance Diagram#
phalanx.storage.config Module#
Parsing and analysis of Phalanx configuration.
Classes#
|
Analyze Phalanx configuration and convert it to models. |
Class Inheritance Diagram#
phalanx.storage.helm Module#
Interface to Helm operations.
Classes#
|
Interface to Helm operations. |
Class Inheritance Diagram#
phalanx.storage.onepassword Module#
Retrieve secrets stored in 1Password via 1Password Connect.
Classes#
|
Retrieve secrets stored in 1Password via 1Password Connect. |
Create 1Password Connect clients for specific environments. |
Class Inheritance Diagram#
phalanx.storage.vault Module#
Store, retrieve, and manipulate data stored in Vault.
Classes#
|
Store, retrieve, and manipulate data stored in Vault. |
Create Vault clients for specific environments. |
Class Inheritance Diagram#
phalanx.yaml Module#
Utility functions for manipulating YAML.
In several places in the Phalanx code, we want to be able to wrap long strings to make them more readable or be able to dump collections.defaultdict objects without adding special object tagging. This module collects utility functions to make this easier.
Classes#
A string that will be folded when encoded in YAML. |