Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: validation errors when no scopes configured #66

Merged
merged 2 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function main () {
const command = core.getInput('command')
const noPublish = core.getInput('noPublish')
const key = core.getInput('key')
const scopes = core.getInput('scopes')
const scopes = core.getInput('scopes') || undefined
MichaelGoberling marked this conversation as resolved.
Show resolved Hide resolved
const clientId = core.getInput('clientId')
const clientSecret = core.getInput('clientSecret')
const techAccId = core.getInput('technicalAccountId')
Expand Down
14 changes: 14 additions & 0 deletions test/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,20 @@ describe('generateOAuthSTSAuthToken', () => {
await expect(generateOAuthSTSAuthToken(inputs)).rejects.toThrow('[generateOAuthSTSAuthToken] Validation errors:')
})

test('scopes is an empty string', async () => {
const inputs = {
ims,
key: 'key',
clientId: 'client-id',
clientSecret: 'client-secret',
techAccId: 'tech-acct-id',
techAccEmail: 'tech-acct-email',
imsOrgId: 'ims-org-id',
scopes: ''
}
await expect(generateOAuthSTSAuthToken(inputs)).rejects.toThrow('[generateOAuthSTSAuthToken] Validation errors:')
})

test('use default scopes', async () => {
const inputs = {
ims,
Expand Down