Skip to content

Commit

Permalink
[Issue #3133] Add auth env vars for login.gov OAuth (#3406)
Browse files Browse the repository at this point in the history
## Summary
Fixes #3133

### Time to review: __5 mins__

## Changes proposed
Added all of the env vars to connect to login.gov

Added secrets to parameter store for all envs

## Additional information
I've previously tested the lower env values locally
  • Loading branch information
chouinar authored Jan 6, 2025
1 parent 80c18be commit e1c1834
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 1 deletion.
6 changes: 5 additions & 1 deletion infra/api/app-config/dev.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,9 @@ module "dev_config" {
# https://docs.aws.amazon.com/opensearch-service/latest/developerguide/what-is.html#choosing-version
search_engine_version = "OpenSearch_2.15"

service_override_extra_environment_variables = {}
service_override_extra_environment_variables = {

# Login.gov OAuth
ENABLE_AUTH_ENDPOINT = 1
}
}
34 changes: 34 additions & 0 deletions infra/api/app-config/env-config/environment-variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@ locals {
# WORKER_THREADS_COUNT = 4
# LOG_LEVEL = "info"
# DB_CONNECTION_POOL_SIZE = 5


# Login.gov OAuth
# Default values point to the IDP integration environment
# which all non-prod environments should use
ENABLE_AUTH_ENDPOINT = 0
LOGIN_GOV_CLIENT_ID = "urn:gov:gsa:openidconnect.profiles:sp:sso:hhs-${var.environment}-simpler-grants-gov"
LOGIN_GOV_ENDPOINT = "https://idp.int.identitysandbox.gov/"
LOGIN_GOV_JWK_ENDPOINT = "https://idp.int.identitysandbox.gov/api/openid_connect/certs"
LOGIN_GOV_AUTH_ENDPOINT = "https://idp.int.identitysandbox.gov/openid_connect/authorize"
LOGIN_GOV_TOKEN_ENDPOINT = "https://idp.int.identitysandbox.gov/api/openid_connect/token"
LOGIN_FINAL_DESTINATION = ""
API_JWT_ISSUER = "simpler-grants-api-${var.environment}"
API_JWT_AUDIENCE = "simpler-grants-api-${var.environment}"
}

# Configuration for secrets
Expand All @@ -24,5 +38,25 @@ locals {
manage_method = "manual"
secret_store_name = "/api/${var.environment}/api-auth-token"
}

LOGIN_GOV_CLIENT_ASSERTION_PRIVATE_KEY = {
manage_method = "manual"
secret_store_name = "/api/${var.environment}/login-gov-client-assertion-private-key"
}

API_JWT_PRIVATE_KEY = {
manage_method = "manual"
secret_store_name = "/api/${var.environment}/api-jwt-private-key"
}

API_JWT_PUBLIC_KEY = {
manage_method = "manual"
secret_store_name = "/api/${var.environment}/api-jwt-public-key"
}

LOGIN_FINAL_DESTINATION = {
manage_method = "manual"
secret_store_name = "/api/${var.environment}/frontend-login-redirect-url"
}
}
}
7 changes: 7 additions & 0 deletions infra/api/app-config/prod.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,12 @@ module "prod_config" {
# Set the opportunity search index to have more shards/replicas in prod
LOAD_OPP_SEARCH_SHARD_COUNT = 3
LOAD_OPP_SEARCH_REPLICA_COUNT = 2

# Login.gov OAuth
ENABLE_AUTH_ENDPOINT = 0
LOGIN_GOV_ENDPOINT = "https://secure.login.gov/"
LOGIN_GOV_JWK_ENDPOINT = "https://secure.login.gov/api/openid_connect/certs"
LOGIN_GOV_AUTH_ENDPOINT = "https://secure.login.gov/openid_connect/authorize"
LOGIN_GOV_TOKEN_ENDPOINT = "https://secure.login.gov/api/openid_connect/token"
}
}
2 changes: 2 additions & 0 deletions infra/api/app-config/staging.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,7 @@ module "staging_config" {
search_engine_version = "OpenSearch_2.15"

service_override_extra_environment_variables = {
# Login.gov OAuth
ENABLE_AUTH_ENDPOINT = 0
}
}

0 comments on commit e1c1834

Please sign in to comment.