Reference Guide

en_environments

This module provides constant definitions to identify the different environments to where Envase applications and services are deployed.

PRD_ENVIRONMENT

Default identifier of the production environment.

PRD_ENVIRONMENTS

Valid identifiers of the production environment.

STG_ENVIRONMENT

Default identifier of the staging environment.

STG_ENVIRONMENTS

Valid identifiers of the staging environment.

DEV_ENVIRONMENT

Default idientifier of the development environment.

DEV_ENVIRONMENTS

Valid identifiers of the development environment.

Services

en_environments.services

The modules in this package provide constant definitions for the different Envase services and utilities to resolve parameters based on a specified environment.

Authorization Service

en_environments.services.auth

This module provides constant definitions to resolve URLs and pool ids for the different Envase environments. It also provides utility functions to retrieve the values using an environment identifier.

PRD_TOKEN_URL

URL to retrieve access token in the production environment.

PRD_POOL_ID

Identifier for the production environment user pool id.

STG_TOKEN_URL

URL to retrieve access token in the staging environment.

STG_POOL_ID

Identifier for the staging environment user pool id.

DEV_TOKEN_URL

URL to retrieve access token in the development environment.

DEV_POOL_ID

Identifier for the development environment user pool id.

get_pool_id(environment)

Returns the Cognito pool identifier for the specified environment. This function is called by clients using Cognito, and it will rarely be needed to be called by applications.

Parameters:

environment (str) – Environment identifier for which to retrieve the pool id.

Returns:

The ID of the Cognito pool setup for the specified environment.

pool_id = get_pool_id('prd')
get_token_url(environment)

Returns the URL to retrieve an access token depending on the environment. This function is called by the clients using OAuth2, and it will rarely be needed to be called by applications.

Parameters:

environment (str) – Environment identifier for which to retrieve the token.

Returns:

The URL where a token can be retrieved for the specified environment.

token_url = get_token_url('prd')

Connect Data Service

en_environments.services.connect

This module provides constant definitions for the base URL of the Connect Data service for each of the Envase environments. It also provides utilities to resolve the URL based on a specified environment identifier.

PRD_CONNECT_URL

URL of the production instance of Envase Vault.

PRD_EVENTS_FUNCTION

Function name for the production environment.

PRD_WEBHOOKS_URL

URL of the production instance of Webhooks.

STG_CONNECT_URL

URL of the staging instance of Envase Vault.

STG_EVENTS_FUNCTION

Function name for the staging environment.

STG_WEBHOOKS_URL

URL of the staging instance of Webhooks

DEV_CONNECT_URL

URL of the development instance of Envase Vault.

DEV_EVENTS_FUNCTION

Function name for the development environment.

DEV_WEBHOOKS_URL

URL of the development instance of Webhooks

get_events_function(environment)

Returns the AWS Lambda function name for the specified environment.

Parameters:

environment (str) – A supported environment identifier. The identifier is case-insensitive.

Returns:

The function name for the specified environment.

Raises:

InvalidEnvironmentError – When the specified environment is not recognized.

func_name = get_events_function('prd')
get_service_url(environment)

Returns the base url of the Envase Vault service for the specified environment.

Parameters:

environment (str) – A supported environment identifier. The identifier is case-insensitive.

Returns:

The root URL for the environment specified.

Raises:

InvalidEnvironmentError – When the specified environment is not recognized.

base_url = get_service_url('prd')
get_webhooks_url(environment)

Returns the base url of the Webhooks service for the specified environment.

Parameters:

environment (str) – A supported environment identifier. The identifier is case-insensitive.

Returns:

The root URL for the environment specified.

Raises:

InvalidEnvironmentError – When the specified environment is not recognized.

base_url = get_webhooks_url('prd')

Core API

en_environments.services.coreapi

This module provides constant definitions for the base URL of the Envase Core API service for each of the environments. It also provides utilities to resolve the URL based on a specified environment identifier.

PRD_COREAPI_URL

URL of the production instance of Envase Vault.

STG_COREAPI_URL

URL of the staging instance of Envase Vault.

DEV_COREAPI_URL

URL of the development instance of Envase Vault.

get_service_url(environment)

Returns the base url of the Envase Core API service for the specified environment.

Parameters:

environment (str) – A supported environment identifier. The identifier is case-insensitive.

Raises:

InvalidEnvironmentError – When the specified environment is not recognized.

base_url = get_service_url('prd')

Identity Manager

en_environments.services.identity

This module provides constant definitions for the base URL of the Envase Identity Manager service for each of the environments. It also provides utilities to resolve the URL based on a specified environment identifier.

PRD_IDENTITY_URL

URL of the production instance of Envase Vault.

STG_IDENTITY_URL

URL of the staging instance of Envase Vault.

DEV_IDENTITY_URL

URL of the development instance of Envase Vault.

get_service_url(environment)

Returns the base url of the Envase Identity service for the specified environment.

Parameters:

environment (str) – A supported environment identifier. The identifier is case-insensitive.

Raises:

InvalidEnvironmentError – When the specified environment is not recognized.

base_url = get_service_url('prd')

Vault Service

en_environments.services.vault

This module provides constant definitions for the base URL of the Vault service for each of the Envase environments. It also provides utilities to resolve the URL based on a specified environment identifier.

PRD_VAULT_URL

URL of the production instance of Envase Vault.

PRD_VAULT_PREFIX

Lambda function prefix for functions in the Envase Vault production environment.

STG_VAULT_URL

URL of the staging instance of Envase Vault.

STG_VAULT_PREFIX

Lambda function prefix for functions in the Envase Vault staging environment.

DEV_VAULT_URL

URL of the development instance of Envase Vault.

DEV_VAULT_PREFIX

Lambda function prefix for functions in the Envase Vault development environment.

get_function_prefix(environment)

Returns the prefix of the AWS Lambda functions for the specified environment.

Parameters:

environment (str) – A supported environment identifier. The identifier is case-insensitive.

Raises:

InvalidEnvironmentError – When the specified environment is not recognized.

prefix = get_function_prefix('prd')
get_service_url(environment)

Returns the base url of the Envase Vault service for the specified environment.

Parameters:

environment (str) – A supported environment identifier. The identifier is case-insensitive.

Raises:

InvalidEnvironmentError – When the specified environment is not recognized.

base_url = get_service_url('prd')