Python DSL reference
ServiceArchitectClient.from_env()Cognito authentication
Authenticate with the same Cognito user pool and SRP flow used by the designer without storing an ID token.
When to use
Use username/password authentication for local automation and CI identities allowed to call the generation API.
Behavior
- The client loads credentials from a local
.envfile when requested. - Cognito
USER_SRP_AUTHderives a proof locally; the password is sent only through the Cognito authentication protocol. - The temporary ID token is sent unchanged in the generation request
Authorizationheader. - An explicit ID token can be supplied when another authentication layer already obtained one.
.env variables properties
Local authentication and endpoint configuration.
PropertyTypeDescription
SERVICE_ARCHITECT_USERNAMEstringCognito username.
SERVICE_ARCHITECT_PASSWORDsecretCognito password.
SERVICE_ARCHITECT_ID_TOKENoptional secretSkip SRP when a valid token is already available.
SERVICE_ARCHITECT_API_URLoptional URLOverride the default designer API environment.
.env
SERVICE_ARCHITECT_USERNAME=user@example.com
SERVICE_ARCHITECT_PASSWORD=change-me
SERVICE_ARCHITECT_ID_TOKEN=
SERVICE_ARCHITECT_API_URL=https://0pc6ljy0hg.execute-api.us-east-1.amazonaws.com/test