Skip to content

Commit 2c89a5b

Browse files
committed
update oauth2 client id from 1password
1 parent 8b1660c commit 2c89a5b

File tree

6 files changed

+18
-5
lines changed

6 files changed

+18
-5
lines changed

.github/workflows/api-deployer.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ on:
5656
description: Validator endpoint
5757
required: true
5858
type: string
59+
OPERATIONS_OAUTH2_CLIENT_ID_1PASSWORD:
60+
description: Oauth client id part of the authoriation for the operations API
61+
required: true
62+
type: string
5963

6064
env:
6165
python_version: '3.11'
@@ -295,11 +299,12 @@ jobs:
295299
env:
296300
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
297301
TRANSITLAND_API_KEY: "op://rbiv7rvkkrsdlpcrz3bmv7nmcu/TansitLand API Key/credential"
302+
OPERATIONS_OAUTH2_CLIENT_ID: ${{ inputs.OPERATIONS_OAUTH2_CLIENT_ID_1PASSWORD }}
298303

299304
- name: Populate Variables
300305
run: |
301306
scripts/replace-variables.sh -in_file infra/backend.conf.rename_me -out_file infra/backend.conf -variables BUCKET_NAME,OBJECT_PREFIX
302-
scripts/replace-variables.sh -in_file infra/vars.tfvars.rename_me -out_file infra/vars.tfvars -variables PROJECT_ID,REGION,ENVIRONMENT,DEPLOYER_SERVICE_ACCOUNT,FEED_API_IMAGE_VERSION,OAUTH2_CLIENT_ID,OAUTH2_CLIENT_SECRET,GLOBAL_RATE_LIMIT_REQ_PER_MINUTE,ARTIFACT_REPO_NAME,VALIDATOR_ENDPOINT,TRANSITLAND_API_KEY
307+
scripts/replace-variables.sh -in_file infra/vars.tfvars.rename_me -out_file infra/vars.tfvars -variables PROJECT_ID,REGION,ENVIRONMENT,DEPLOYER_SERVICE_ACCOUNT,FEED_API_IMAGE_VERSION,OAUTH2_CLIENT_ID,OAUTH2_CLIENT_SECRET,GLOBAL_RATE_LIMIT_REQ_PER_MINUTE,ARTIFACT_REPO_NAME,VALIDATOR_ENDPOINT,TRANSITLAND_API_KEY,OPERATIONS_OAUTH2_CLIENT_ID
303308
304309
- uses: hashicorp/setup-terraform@v3
305310
with:

.github/workflows/api-dev.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
GLOBAL_RATE_LIMIT_REQ_PER_MINUTE: ${{ vars.GLOBAL_RATE_LIMIT_REQ_PER_MINUTE }}
2323
TF_APPLY: true
2424
VALIDATOR_ENDPOINT: https://stg-gtfs-validator-web-mbzoxaljzq-ue.a.run.app
25+
OPERATIONS_OAUTH2_CLIENT_ID_1PASSWORD: "op://rbiv7rvkkrsdlpcrz3bmv7nmcu/GCP_FEEDS_API_TOKEN_OAUTH2_DEV/username"
2526
secrets:
2627
GCP_MOBILITY_FEEDS_SA_KEY: ${{ secrets.DEV_GCP_MOBILITY_FEEDS_SA_KEY }}
2728
OAUTH2_CLIENT_ID: ${{ secrets.DEV_MOBILITY_FEEDS_OAUTH2_CLIENT_ID}}

infra/functions-python/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ resource "google_cloudfunctions2_function" "operations_api" {
612612
environment_variables = {
613613
PROJECT_ID = var.project_id
614614
PYTHONNODEBUGRANGES = 0
615-
GOOGLE_CLIENT_ID = var.authorization_google_client_id
615+
GOOGLE_CLIENT_ID = var.operations_oauth2_client_id
616616
}
617617
available_memory = local.function_operations_api_config.memory
618618
timeout_seconds = local.function_operations_api_config.timeout

infra/functions-python/vars.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ variable "transitland_api_key" {
7070
description = "Transitland API key"
7171
}
7272

73-
variable "authorization_google_client_id" {
73+
variable "operations_oauth2_client_id" {
7474
type = string
75-
description = "Google client ID"
75+
description = "value of the OAuth2 client id for the Operations API"
7676
}

infra/vars.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,9 @@ variable "validator_endpoint" {
6666

6767
variable "transitland_api_key" {
6868
type = string
69+
}
70+
71+
variable "operations_oauth2_client_id" {
72+
type = string
73+
description = "value of the OAuth2 client id for the Operations API"
6974
}

infra/vars.tfvars.rename_me

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ oauth2_client_secret = {{OAUTH2_CLIENT_SECRET}}
1717
global_rate_limit_req_per_minute = {{GLOBAL_RATE_LIMIT_REQ_PER_MINUTE}}
1818

1919
validator_endpoint = {{VALIDATOR_ENDPOINT}}
20-
transitland_api_key = {{TRANSITLAND_API_KEY}}
20+
transitland_api_key = {{TRANSITLAND_API_KEY}}
21+
22+
operations_oauth2_client_id = {{OPERATIONS_OAUTH2_CLIENT_ID}}

0 commit comments

Comments
 (0)