Skip to content

Fix double quote escaping in OKTA secrets creation script #176

@wakariyasuku

Description

@wakariyasuku

Description

The build-script/secure-secrets-creation.sh script fails to create OKTA secrets when environment variables contain values wrapped in double quotes. This results in malformed JSON with double-escaped quotes.

  • [] ✋ I have searched the open/closed issues and my issue is not listed.

Versions

  • Harmonix on AWS version: v0.4.0

Reproduction Code

  1. Set OKTA environment variables with quoted values in .env:

    • OKTA_CLIENT_ID="masked_client_id"
    • OKTA_CLIENT_SECRET="masked_secret"
    • OKTA_AUDIENCE="https://masked.okta.com"
    • OKTA_API_TOKEN="masked_token"
  2. Run make install

  3. ECS task fails with: ResourceInitializationError: unable to pull secrets or registry auth: execution resource retrieval failed: unable to retrieve secret from asm: service call has been retried 1 time(s): invalid character '0' after object key:value pair

Expected behavior

OKTA secrets should be created successfully regardless of whether environment variables are quoted or unquoted.

Actual behavior

Script generates malformed JSON with double-escaped quotes:

{"clientId": ""masked_client_id"", "clientSecret": ""masked_secret"", "audience": ""https://masked.okta.com"", "authServerId": "", "idp": "", "apiToken": ""masked_token""}

The double quotes around values cause JSON parsing to fail when AWS Secrets Manager tries to retrieve the secret.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions