Skip to content

Commit

Permalink
add token renewal endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
kang-makes committed Jul 19, 2024
1 parent 1b531f1 commit f4b5af0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions recipes/newrelic/infrastructure/super-agent/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -454,13 +454,13 @@ install:
- |
if [ "{{.NEW_RELIC_SUPER_AGENT_FLEET_ENABLED}}" = "false" ] && [ "{{ .NEW_RELIC_ORGANIZATION }}" != "" ]; then
sed -i '/^\s*auth_config: PLACEHOLDER/s/^/#/' /etc/newrelic-super-agent/config.yaml
# TODO: sed -i '/^\s*token_url: PLACEHOLDER/s/^/#/' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*token_url: PLACEHOLDER/s/^/#/' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*client_id: PLACEHOLDER/s/^/#/' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*provider: PLACEHOLDER/s/^/#/' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*private_key_path: PLACEHOLDER/s/^/#/' /etc/newrelic-super-agent/config.yaml
else
sed -i '/^\s*#\s*auth_config: PLACEHOLDER/s/# //' /etc/newrelic-super-agent/config.yaml
# TODO: sed -i '/^\s*#\s*token_url: PLACEHOLDER/s/# //' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*#\s*token_url: PLACEHOLDER/s/# //' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*#\s*client_id: PLACEHOLDER/s/# //' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*#\s*provider: PLACEHOLDER/s/# //' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*#\s*private_key_path: PLACEHOLDER/s/# //' /etc/newrelic-super-agent/config.yaml
Expand All @@ -480,13 +480,13 @@ install:
if [ "{{.NEW_RELIC_REGION}}" = "STAGING" ]; then
REGISTRATION_ENDPOINT=https://staging-iam-service.vip.cf.nr-ops.net/system-identity/graphql
# TODO: TOKEN_RENEWAL_ENDPOINT
TOKEN_RENEWAL_ENDPOINT = https://staging-system-identity-oauth.vip.cf.nr-ops.net/oauth2/token
elif [ "{{.NEW_RELIC_REGION}}" = "EU" ]; then
REGISTRATION_ENDPOINT=https://iam-service.eu.vip.cf.nr-ops.net/system-identity/graphql
# TODO: TOKEN_RENEWAL_ENDPOINT
TOKEN_RENEWAL_ENDPOINT = https://system-identity-oauth.eu.vip.cf.nr-ops.net/oauth2/token
else
REGISTRATION_ENDPOINT=https://iam-service.vip.cf.nr-ops.net/system-identity/graphql
# TODO: TOKEN_RENEWAL_ENDPOINT
TOKEN_RENEWAL_ENDPOINT = https://system-identity-oauth.vip.cf.nr-ops.net/oauth2/token
fi
NAME="System Identity for $(hostname)"
Expand Down Expand Up @@ -534,7 +534,7 @@ install:
NAME=$(/usr/local/bin/newrelic utils jq -r '.data.createSystemIdentity.name' < "$TEMPORAL_FOLDER/response.json")
mv "$TEMPORAL_FOLDER/key" "/etc/newrelic-super-agent/keys/$CLIENT_ID.key"
# TODO: sed -i 's/token_url: PLACEHOLDER/token_url: '"$TOKEN_RENEWAL_ENDPOINT"'/g' /etc/newrelic-super-agent/config.yaml
sed -i 's/token_url: PLACEHOLDER/token_url: '"$TOKEN_RENEWAL_ENDPOINT"'/g' /etc/newrelic-super-agent/config.yaml
sed -i 's/client_id: PLACEHOLDER/client_id: '"$CLIENT_ID"'/g' /etc/newrelic-super-agent/config.yaml
sed -i 's/provider: PLACEHOLDER/provider: local/g' /etc/newrelic-super-agent/config.yaml
sed -i 's/private_key_path: PLACEHOLDER/private_key_path: '"/etc/newrelic-super-agent/keys/$CLIENT_ID.key"'/g' /etc/newrelic-super-agent/config.yaml
Expand Down
12 changes: 6 additions & 6 deletions recipes/newrelic/infrastructure/super-agent/rhel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -394,13 +394,13 @@ install:
- |
if [ "{{.NEW_RELIC_SUPER_AGENT_FLEET_ENABLED}}" = "false" ] && [ "{{ .NEW_RELIC_ORGANIZATION }}" != "" ]; then
sed -i '/^\s*auth_config: PLACEHOLDER/s/^/#/' /etc/newrelic-super-agent/config.yaml
# TODO: sed -i '/^\s*token_url: PLACEHOLDER/s/^/#/' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*token_url: PLACEHOLDER/s/^/#/' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*client_id: PLACEHOLDER/s/^/#/' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*provider: PLACEHOLDER/s/^/#/' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*private_key_path: PLACEHOLDER/s/^/#/' /etc/newrelic-super-agent/config.yaml
else
sed -i '/^\s*#\s*auth_config: PLACEHOLDER/s/# //' /etc/newrelic-super-agent/config.yaml
# TODO: sed -i '/^\s*#\s*token_url: PLACEHOLDER/s/# //' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*#\s*token_url: PLACEHOLDER/s/# //' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*#\s*client_id: PLACEHOLDER/s/# //' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*#\s*provider: PLACEHOLDER/s/# //' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*#\s*private_key_path: PLACEHOLDER/s/# //' /etc/newrelic-super-agent/config.yaml
Expand All @@ -420,13 +420,13 @@ install:
if [ "{{.NEW_RELIC_REGION}}" = "STAGING" ]; then
REGISTRATION_ENDPOINT=https://staging-iam-service.vip.cf.nr-ops.net/system-identity/graphql
# TODO: TOKEN_RENEWAL_ENDPOINT
TOKEN_RENEWAL_ENDPOINT = https://staging-system-identity-oauth.vip.cf.nr-ops.net/oauth2/token
elif [ "{{.NEW_RELIC_REGION}}" = "EU" ]; then
REGISTRATION_ENDPOINT=https://iam-service.eu.vip.cf.nr-ops.net/system-identity/graphql
# TODO: TOKEN_RENEWAL_ENDPOINT
TOKEN_RENEWAL_ENDPOINT = https://system-identity-oauth.eu.vip.cf.nr-ops.net/oauth2/token
else
REGISTRATION_ENDPOINT=https://iam-service.vip.cf.nr-ops.net/system-identity/graphql
# TODO: TOKEN_RENEWAL_ENDPOINT
TOKEN_RENEWAL_ENDPOINT = https://system-identity-oauth.vip.cf.nr-ops.net/oauth2/token
fi
NAME="System Identity for $(hostname)"
Expand Down Expand Up @@ -474,7 +474,7 @@ install:
NAME=$(/usr/local/bin/newrelic utils jq -r '.data.createSystemIdentity.name' < "$TEMPORAL_FOLDER/response.json")
mv "$TEMPORAL_FOLDER/key" "/etc/newrelic-super-agent/keys/$CLIENT_ID.key"
# TODO: sed -i 's/token_url: PLACEHOLDER/token_url: '"$TOKEN_RENEWAL_ENDPOINT"'/g' /etc/newrelic-super-agent/config.yaml
sed -i 's/token_url: PLACEHOLDER/token_url: '"$TOKEN_RENEWAL_ENDPOINT"'/g' /etc/newrelic-super-agent/config.yaml
sed -i 's/client_id: PLACEHOLDER/client_id: '"$CLIENT_ID"'/g' /etc/newrelic-super-agent/config.yaml
sed -i 's/provider: PLACEHOLDER/provider: local/g' /etc/newrelic-super-agent/config.yaml
sed -i 's/private_key_path: PLACEHOLDER/private_key_path: '"/etc/newrelic-super-agent/keys/$CLIENT_ID.key"'/g' /etc/newrelic-super-agent/config.yaml
Expand Down
12 changes: 6 additions & 6 deletions recipes/newrelic/infrastructure/super-agent/suse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -343,13 +343,13 @@ install:
- |
if [ "{{.NEW_RELIC_SUPER_AGENT_FLEET_ENABLED}}" = "false" ] && [ "{{ .NEW_RELIC_ORGANIZATION }}" != "" ]; then
sed -i '/^\s*auth_config: PLACEHOLDER/s/^/#/' /etc/newrelic-super-agent/config.yaml
# TODO: sed -i '/^\s*token_url: PLACEHOLDER/s/^/#/' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*token_url: PLACEHOLDER/s/^/#/' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*client_id: PLACEHOLDER/s/^/#/' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*provider: PLACEHOLDER/s/^/#/' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*private_key_path: PLACEHOLDER/s/^/#/' /etc/newrelic-super-agent/config.yaml
else
sed -i '/^\s*#\s*auth_config: PLACEHOLDER/s/# //' /etc/newrelic-super-agent/config.yaml
# TODO: sed -i '/^\s*#\s*token_url: PLACEHOLDER/s/# //' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*#\s*token_url: PLACEHOLDER/s/# //' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*#\s*client_id: PLACEHOLDER/s/# //' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*#\s*provider: PLACEHOLDER/s/# //' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*#\s*private_key_path: PLACEHOLDER/s/# //' /etc/newrelic-super-agent/config.yaml
Expand All @@ -369,13 +369,13 @@ install:
if [ "{{.NEW_RELIC_REGION}}" = "STAGING" ]; then
REGISTRATION_ENDPOINT=https://staging-iam-service.vip.cf.nr-ops.net/system-identity/graphql
# TODO: TOKEN_RENEWAL_ENDPOINT
TOKEN_RENEWAL_ENDPOINT = https://staging-system-identity-oauth.vip.cf.nr-ops.net/oauth2/token
elif [ "{{.NEW_RELIC_REGION}}" = "EU" ]; then
REGISTRATION_ENDPOINT=https://iam-service.eu.vip.cf.nr-ops.net/system-identity/graphql
# TODO: TOKEN_RENEWAL_ENDPOINT
TOKEN_RENEWAL_ENDPOINT = https://system-identity-oauth.eu.vip.cf.nr-ops.net/oauth2/token
else
REGISTRATION_ENDPOINT=https://iam-service.vip.cf.nr-ops.net/system-identity/graphql
# TODO: TOKEN_RENEWAL_ENDPOINT
TOKEN_RENEWAL_ENDPOINT = https://system-identity-oauth.vip.cf.nr-ops.net/oauth2/token
fi
NAME="System Identity for $(hostname)"
Expand Down Expand Up @@ -423,7 +423,7 @@ install:
NAME=$(/usr/local/bin/newrelic utils jq -r '.data.createSystemIdentity.name' < "$TEMPORAL_FOLDER/response.json")
mv "$TEMPORAL_FOLDER/key" "/etc/newrelic-super-agent/keys/$CLIENT_ID.key"
# TODO: sed -i 's/token_url: PLACEHOLDER/token_url: '"$TOKEN_RENEWAL_ENDPOINT"'/g' /etc/newrelic-super-agent/config.yaml
sed -i 's/token_url: PLACEHOLDER/token_url: '"$TOKEN_RENEWAL_ENDPOINT"'/g' /etc/newrelic-super-agent/config.yaml
sed -i 's/client_id: PLACEHOLDER/client_id: '"$CLIENT_ID"'/g' /etc/newrelic-super-agent/config.yaml
sed -i 's/provider: PLACEHOLDER/provider: local/g' /etc/newrelic-super-agent/config.yaml
sed -i 's/private_key_path: PLACEHOLDER/private_key_path: '"/etc/newrelic-super-agent/keys/$CLIENT_ID.key"'/g' /etc/newrelic-super-agent/config.yaml
Expand Down

0 comments on commit f4b5af0

Please sign in to comment.