Update legacy_options_test.go

This commit is contained in:
lohith-karlapudi 2022-08-12 15:25:54 +05:30
parent 1d1e415277
commit c0fe7f62da
3 changed files with 60 additions and 62 deletions

View File

@ -3,7 +3,7 @@ name: CI
on:
push:
branches:
- 'add_id_token_header'
- 'edi-foundation-integration'
# - $default-branch
paths-ignore:
- 'VERSION'
@ -159,66 +159,66 @@ jobs:
docker push ${{ env.CI_LATEST_IMAGE }}
docker push ${{ env.CI_IMAGE }}
# Deploy_Test_HDS_AUTH_GATEWAY:
# needs: [Build, Blackduck, Fortify, unit-test]
# uses: ./.github/workflows/deploy-hds-auth-gateway.yaml
# with:
# OAUTH2_PROXY_IMAGE: ${{ needs.Build.outputs.envoyAlphaTag }}
# secrets:
# VAULT_HOST: ${{ secrets.VAULT_HOST }}
# VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }}
# VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }}
Deploy_Test_HDS_AUTH_GATEWAY:
needs: [Build, Blackduck, Fortify, unit-test]
uses: ./.github/workflows/deploy-hds-auth-gateway.yaml
with:
OAUTH2_PROXY_IMAGE: ${{ needs.Build.outputs.envoyAlphaTag }}
secrets:
VAULT_HOST: ${{ secrets.VAULT_HOST }}
VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }}
VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }}
# Promote_Version:
# needs: [Deploy_Test_HDS_AUTH_GATEWAY]
# if: github.ref == 'refs/heads/edi-foundation-integration'
# runs-on: ubuntu-20.04
# outputs:
# versionTag: ${{ steps.setVariables.outputs.versionTag }}
# steps:
# - uses: actions/checkout@v2
Promote_Version:
needs: [Deploy_Test_HDS_AUTH_GATEWAY]
if: github.ref == 'refs/heads/edi-foundation-integration'
runs-on: ubuntu-20.04
outputs:
versionTag: ${{ steps.setVariables.outputs.versionTag }}
steps:
- uses: actions/checkout@v2
# - name: Import Secrets
# id: secrets
# uses: hashicorp/vault-action@v2.3.1
# with:
# url: ${{ secrets.VAULT_HOST }}
# method: approle
# roleId: ${{ secrets.VAULT_ROLE_ID }}
# secretId: ${{ secrets.VAULT_SECRET_ID }}
# exportEnv: true
# secrets: |
# devops/data/docker-repos/hsdp-edi endPoint | HSDP_DOCKER_REGISTRY ;
# devops/data/docker-repos/hsdp-edi user | HSDP_DOCKER_USER ;
# devops/data/docker-repos/hsdp-edi password | HSDP_DOCKER_PASSWORD ;
- name: Import Secrets
id: secrets
uses: hashicorp/vault-action@v2.3.1
with:
url: ${{ secrets.VAULT_HOST }}
method: approle
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}
exportEnv: true
secrets: |
devops/data/docker-repos/hsdp-edi endPoint | HSDP_DOCKER_REGISTRY ;
devops/data/docker-repos/hsdp-edi user | HSDP_DOCKER_USER ;
devops/data/docker-repos/hsdp-edi password | HSDP_DOCKER_PASSWORD ;
# - name: Set env variables
# id: setVariables
# run: |
# new_version=`cat VERSION`
# echo "New version is: $new_version"
# echo "CI_IMAGE=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${new_version}-alpha" >> "$GITHUB_ENV"
# echo "RC_IMAGE=docker.na1.hsdp.io/edisp-releases/edi-foundation-oauth2-proxy:${new_version}-rc" >> "$GITHUB_ENV"
# echo "::set-output name=versionTag::${new_version}-rc"
# echo "${new_version}-rc"
- name: Set env variables
id: setVariables
run: |
new_version=`cat VERSION`
echo "New version is: $new_version"
echo "CI_IMAGE=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${new_version}-alpha" >> "$GITHUB_ENV"
echo "RC_IMAGE=docker.na1.hsdp.io/edisp-releases/edi-foundation-oauth2-proxy:${new_version}-rc" >> "$GITHUB_ENV"
echo "::set-output name=versionTag::${new_version}-rc"
echo "${new_version}-rc"
# - name: Docker login
# run: |
# docker login --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' '${{ secrets.DOCKER_REPO }}'
- name: Docker login
run: |
docker login --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' '${{ secrets.DOCKER_REPO }}'
# - name: Docker Push
# run: |
# docker pull ${{ env.CI_IMAGE }}
# docker tag ${{ env.CI_IMAGE }} ${{ env.RC_IMAGE }}
# docker push ${{ env.RC_IMAGE }}
- name: Docker Push
run: |
docker pull ${{ env.CI_IMAGE }}
docker tag ${{ env.CI_IMAGE }} ${{ env.RC_IMAGE }}
docker push ${{ env.RC_IMAGE }}
# Replace_OAuth2_Proxy_Tag_in_Terraform_API_Gateway:
# needs: [Promote_Version]
# if: github.ref == 'refs/heads/edi-foundation-integration'
# uses: ./.github/workflows/update-oauth2-proxy-version-at-api-gw.yaml
# with:
# OAUTH2_PROXY_IMAGE: ${{ needs.Promote_Version.outputs.versionTag }}
# secrets:
# VAULT_HOST: ${{ secrets.VAULT_HOST }}
# VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }}
# VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }}
Replace_OAuth2_Proxy_Tag_in_Terraform_API_Gateway:
needs: [Promote_Version]
if: github.ref == 'refs/heads/edi-foundation-integration'
uses: ./.github/workflows/update-oauth2-proxy-version-at-api-gw.yaml
with:
OAUTH2_PROXY_IMAGE: ${{ needs.Promote_Version.outputs.versionTag }}
secrets:
VAULT_HOST: ${{ secrets.VAULT_HOST }}
VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }}
VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }}

View File

@ -374,8 +374,7 @@ func getAuthorizationHeader() []Header {
Values: []HeaderValue{
{
ClaimSource: &ClaimSource{
Claim: "id_token",
Prefix: "Bearer ",
Claim: "id_token",
},
},
},

View File

@ -477,8 +477,7 @@ var _ = Describe("Legacy Options", func() {
Values: []HeaderValue{
{
ClaimSource: &ClaimSource{
Claim: "id_token",
Prefix: "Bearer ",
Claim: "id_token",
},
},
},