Skip to content

Commit e9acf24

Browse files
committed
Revert "Hash OAuth client secret internally"
This reverts commit cbe229d.
1 parent 702082d commit e9acf24

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

images/osm-sandbox-web/pre_start.sh

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,9 @@ while [ "$flag" = true ]; do
2727
fi
2828
done
2929

30-
# Check required TM OAuth environment variables
31-
if [[ -z "${TM_OAUTH_CLIENT_ID}" ]]; then
32-
echo "ERROR: TM_OAUTH_CLIENT_ID environment variable is required but not set"
33-
exit 1
34-
fi
35-
36-
if [[ -z "${TM_OAUTH_CLIENT_SECRET}" ]]; then
37-
echo "ERROR: TM_OAUTH_CLIENT_SECRET environment variable is required but not set"
38-
exit 1
39-
fi
40-
41-
# Compute hashed secret for database storage
42-
TM_OAUTH_CLIENT_SECRET_HASHED=$(echo -n "${TM_OAUTH_CLIENT_SECRET}" | sha256sum | cut -d' ' -f1)
30+
# TODO: Get actual environment variable replacement working
31+
TM_OAUTH_CLIENT_ID="7yDot3Plq2g0cbapXcTEpSKldYWDk-BTyeUNl6YtC0I"
32+
TM_OAUTH_CLIENT_SECRET_HASHED="3964467e2b098792858b163f69f673a5846254dc8af671d33ef03b36a9cac6e8"
4333

4434
psql -h $POSTGRES_HOST -U $POSTGRES_USER -d $POSTGRES_DB -c "INSERT INTO oauth_applications (owner_type, owner_id, name, uid, secret, redirect_uri, scopes, confidential, created_at, updated_at) VALUES ('User', 1, 'Tasking Manager', '${TM_OAUTH_CLIENT_ID}', '${TM_OAUTH_CLIENT_SECRET_HASHED}', E'https://tasks.openstreetmap.us/static/sandbox-id/land2.html\r\nhttps://tasks.teachosm.org/static/pdeditor/land2.html', 'read_prefs write_prefs write_api read_gpx write_notes', false, now() at time zone 'utc', now() at time zone 'utc');"
4535

values.template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ osm-seed:
7272
# WEB_TIMEOUT: 600
7373
BACKUP_FILE_URL: https://osmsandbox.us/backup-fixed.sql
7474
TM_OAUTH_CLIENT_ID: "none"
75-
TM_OAUTH_CLIENT_SECRET: "none"
75+
TM_OAUTH_CLIENT_SECRET_HASHED: "none"
7676
resources:
7777
enabled: false
7878
requests:

0 commit comments

Comments
 (0)