Skip to content

Commit

Permalink
test-v1.4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
MoChilia committed Nov 21, 2023
1 parent 5fef06a commit 7bf0e0d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 125 deletions.
84 changes: 15 additions & 69 deletions .github/workflows/azure-login-negative.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,9 @@ jobs:
environment: Automation test

steps:
- name: 'Checking out repo code'
uses: actions/checkout@v3.5.2

- name: Set Node.js 16.x for GitHub Action
uses: actions/setup-node@v1
with:
node-version: 16.x

- name: 'Validate build'
run: |
npm install
npm run build
npm run test
- name: Login with creds
continue-on-error: true
uses: ./
uses: azure/login@1.4.6
with:
creds: ${{secrets.SP1}}
enable-AzPSSession: true
Expand Down Expand Up @@ -61,7 +47,7 @@ jobs:
- name: Login with individual parameters
id: login_2
uses: ./
uses: azure/login@1.4.6
with:
client-id: ${{ secrets.OIDC_SP2_CLIENT_ID }}
tenant-id: ${{ secrets.OIDC_SP2_TENANT_ID }}
Expand Down Expand Up @@ -97,22 +83,8 @@ jobs:
environment: Automation test

steps:

- name: 'Checking out repo code'
uses: actions/checkout@v3.5.2

- name: Set Node.js 16.x for GitHub Action
uses: actions/setup-node@v1
with:
node-version: 16.x

- name: 'Validate build'
run: |
npm install
npm run build
- name: Login with individual parameters
uses: ./
uses: azure/login@1.4.6
with:
client-id: ${{ secrets.OIDC_SP2_CLIENT_ID }}
tenant-id: ${{ secrets.OIDC_SP2_TENANT_ID }}
Expand Down Expand Up @@ -161,23 +133,10 @@ jobs:
environment: Automation test

steps:
- name: 'Checking out repo code'
uses: actions/checkout@v3.5.2

- name: Set Node.js 16.x for GitHub Action
uses: actions/setup-node@v1
with:
node-version: 16.x

- name: 'Validate build'
run: |
npm install
npm run build
- name: Login with creds, missing parameters in creds
id: login_4
continue-on-error: true
uses: ./
uses: azure/login@1.4.6
with:
creds: ${{secrets.SP3_NO_Secret}}
enable-AzPSSession: true
Expand All @@ -192,7 +151,7 @@ jobs:
- name: Login with creds, wrong keys
id: login_5
continue-on-error: true
uses: ./
uses: azure/login@1.4.6
with:
creds: ${{secrets.SP4_Wrong_Key}}
enable-AzPSSession: true
Expand All @@ -207,7 +166,7 @@ jobs:
- name: Login with creds, no creds or individual parameters
id: login_6
continue-on-error: true
uses: ./
uses: azure/login@1.4.6
with:
enable-AzPSSession: true

Expand All @@ -221,7 +180,7 @@ jobs:
- name: Login with individual parameters, only client-id, no tenant-id, subscription-id
id: login_7
continue-on-error: true
uses: ./
uses: azure/login@1.4.6
with:
client-id: ${{ secrets.OIDC_SP2_CLIENT_ID }}
allow-no-subscriptions: true
Expand All @@ -237,7 +196,7 @@ jobs:
- name: Login with individual parameters, only tenant-id, subscription-id, no client-id
id: login_8
continue-on-error: true
uses: ./
uses: azure/login@1.4.6
with:
tenant-id: ${{ secrets.OIDC_SP2_TENANT_ID }}
subscription-id: ${{ secrets.OIDC_SP2_SUBSCRIPTION_ID }}
Expand All @@ -252,7 +211,7 @@ jobs:
core.setFailed('Last action should fail but not. Please check it.')
- name: Login with creds, disable ps session
uses: ./
uses: azure/login@1.4.6
with:
creds: ${{secrets.SP1}}
enable-AzPSSession: false
Expand Down Expand Up @@ -282,7 +241,7 @@ jobs:
core.setFailed('Last action should fail but not. Please check it.')
- name: Login with creds, wrong boolean value
uses: ./
uses: azure/login@1.4.6
with:
creds: ${{secrets.SP1}}
enable-AzPSSession: notboolean
Expand Down Expand Up @@ -314,7 +273,7 @@ jobs:
- name: Login with individual parameters, with a wrong audience
id: login_10
continue-on-error: true
uses: ./
uses: azure/login@1.4.6
with:
client-id: ${{ secrets.OIDC_SP2_CLIENT_ID }}
tenant-id: ${{ secrets.OIDC_SP2_TENANT_ID }}
Expand All @@ -333,7 +292,7 @@ jobs:
- name: Login with tenant-level account, without allow-no-subscriptions
id: login_11
continue-on-error: true
uses: ./
uses: azure/login@1.4.6
with:
client-id: ${{ secrets.OIDC_SP2_CLIENT_ID }}
tenant-id: ${{ secrets.OIDC_SP2_TENANT_ID }}
Expand All @@ -351,7 +310,7 @@ jobs:
- name: Login with both creds and individual parameters
id: login_12
continue-on-error: true
uses: ./
uses: azure/login@1.4.6
with:
creds: ${{secrets.SP1}}
client-id: ${{ secrets.OIDC_SP2_CLIENT_ID }}
Expand All @@ -370,7 +329,7 @@ jobs:
- name: Login by OIDC with all info in creds
id: login_13
continue-on-error: true
uses: ./
uses: azure/login@1.4.6
with:
creds: ${{secrets.SP2}}
allow-no-subscriptions: true
Expand All @@ -391,23 +350,10 @@ jobs:
environment: Automation test

steps:
- name: 'Checking out repo code'
uses: actions/checkout@v3.5.2

- name: Set Node.js 16.x for GitHub Action
uses: actions/setup-node@v1
with:
node-version: 16.x

- name: 'Validate build'
run: |
npm install
npm run build
- name: Login with system-assigned managed identity without auth-type
id: login_14
continue-on-error: true
uses: ./
uses: azure/login@1.4.6

- name: Check Last step failed
if: steps.login_14.outcome == 'success'
Expand Down
68 changes: 12 additions & 56 deletions .github/workflows/azure-login-positive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,8 @@ jobs:
environment: Automation test

steps:
- name: 'Checking out repo code'
uses: actions/checkout@v3.5.2

- name: Set Node.js 16.x for GitHub Action
uses: actions/setup-node@v1
with:
node-version: 16.x

- name: 'Validate build'
run: |
npm install
npm run build
- name: 'Run L0 tests'
run: |
npm run test
- name: Login with creds
uses: ./
uses: azure/login@1.4.6
with:
creds: ${{secrets.SP1}}
enable-AzPSSession: true
Expand All @@ -59,7 +42,7 @@ jobs:
}
- name: Login with individual parameters
uses: ./
uses: azure/login@1.4.6
with:
client-id: ${{ secrets.OIDC_SP2_CLIENT_ID }}
tenant-id: ${{ secrets.OIDC_SP2_TENANT_ID }}
Expand All @@ -82,7 +65,7 @@ jobs:
}
- name: Login with explicit auth-type
uses: ./
uses: azure/login@1.4.6
with:
creds: ${{secrets.SP1}}
auth-type: SERVICE_PRINCIPAL
Expand Down Expand Up @@ -114,21 +97,8 @@ jobs:
environment: Automation test

steps:
- name: 'Checking out repo code'
uses: actions/checkout@v3.5.2

- name: Set Node.js 16.x for GitHub Action
uses: actions/setup-node@v1
with:
node-version: 16.x

- name: 'Validate build'
run: |
npm install
npm run build
- name: Login with creds, disable ps session
uses: ./
uses: azure/login@1.4.6
with:
creds: ${{secrets.SP1}}
enable-AzPSSession: false
Expand All @@ -140,7 +110,7 @@ jobs:
az vm list --output none
- name: Login with creds, wrong boolean value
uses: ./
uses: azure/login@1.4.6
with:
creds: ${{secrets.SP1}}
enable-AzPSSession: notboolean
Expand All @@ -152,7 +122,7 @@ jobs:
az vm list --output none
- name: Login with creds, allow no subscription
uses: ./
uses: azure/login@1.4.6
with:
creds: ${{secrets.SP1}}
allow-no-subscriptions: true
Expand All @@ -177,7 +147,7 @@ jobs:
}
- name: Login with individual parameters, no subscription, allow no subscription
uses: ./
uses: azure/login@1.4.6
with:
client-id: ${{ secrets.OIDC_SP2_CLIENT_ID }}
tenant-id: ${{ secrets.OIDC_SP2_TENANT_ID }}
Expand All @@ -199,7 +169,7 @@ jobs:
}
- name: Login with creds, no subscription, allow no subscription
uses: ./
uses: azure/login@1.4.6
with:
creds: '{"clientId":"${{ secrets.OIDC_SP2_CLIENT_ID }}","clientSecret":"${{ secrets.SP2_CLIENT_SECRET }}","tenantId":"${{ secrets.OIDC_SP2_TENANT_ID }}"}'
allow-no-subscriptions: true
Expand All @@ -208,7 +178,6 @@ jobs:
- name: Run Azure Cli
run: |
az account show --output none
- name: Run Azure PowerShell
uses: azure/powershell@v1.2.0
with:
Expand All @@ -227,21 +196,8 @@ jobs:
environment: Automation test

steps:
- name: 'Checking out repo code'
uses: actions/checkout@v3.5.2

- name: Set Node.js 16.x for GitHub Action
uses: actions/setup-node@v1
with:
node-version: 16.x

- name: 'Validate build'
run: |
npm install
npm run build
- name: Login with system-assigned managed identity, no subscription-id
uses: ./
uses: azure/login@1.4.6
with:
auth-type: IDENTITY
allow-no-subscriptions: true
Expand All @@ -262,7 +218,7 @@ jobs:
}
- name: Login with system-assigned managed identity, with subscription id
uses: ./
uses: azure/login@1.4.6
with:
auth-type: IDENTITY
subscription-id: ${{ secrets.AZURE_SUBSCRIPTIONID }}
Expand All @@ -287,7 +243,7 @@ jobs:
}
- name: Login with tenant-level user-assigned managed identity with allow-no-subscriptions
uses: ./
uses: azure/login@1.4.6
with:
client-id: ${{ secrets.UMI2_CLIENT_ID }}
allow-no-subscriptions: true
Expand All @@ -309,7 +265,7 @@ jobs:
}
- name: Login with user-assigned managed identity, subscription-id
uses: ./
uses: azure/login@1.4.6
with:
client-id: ${{ secrets.UMI1_CLIENT_ID }}
subscription-id: ${{ secrets.UMI1_SUBSCRIPTION_ID }}
Expand Down

0 comments on commit 7bf0e0d

Please sign in to comment.