Skip to content

Fix token validation to support both sgu_ and sgo_ prefixes - #40

Merged
taherkk merged 3 commits into
mainfrom
copilot/fix-api-token-support
Jun 11, 2026
Merged

Fix token validation to support both sgu_ and sgo_ prefixes#40
taherkk merged 3 commits into
mainfrom
copilot/fix-api-token-support

Conversation

Copilot AI commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

sg-cli only accepted sgu_ (personal) tokens, rejecting valid sgo_ (organization) tokens.

  • Updated the token prefix check to accept both sgu_ and sgo_ prefixes
  • Updated the error message to clarify both token types are supported
# Before
if [ -z "${API_TOKEN}" ] || [ "sgu_" != "${API_TOKEN:0:4}" ]; then

# After
if [ -z "${API_TOKEN}" ] || { [ "${API_TOKEN:0:4}" != "sgu_" ] && [ "${API_TOKEN:0:4}" != "sgo_" ]; }; then

Copilot AI changed the title [WIP] Fix sg-cli to support both personal and org tokens Fix token validation to support both sgu_ and sgo_ prefixes Jun 11, 2026
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI requested a review from arunim2405 June 11, 2026 08:59
@arunim2405
arunim2405 marked this pull request as ready for review June 11, 2026 09:05
@taherkk
taherkk merged commit 4059335 into main Jun 11, 2026
1 check passed
@taherkk
taherkk deleted the copilot/fix-api-token-support branch June 11, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sg-cli supports only sgu_ (personal token) and doesn't support sgo_ (org token). It should support both

3 participants