Skip to content

Sync test: Add test to ensure that a connector bad credentials returns the correct GRPC status. - #110

Merged
ggreer merged 1 commit into
mainfrom
ggreer/bad-credential-test
Aug 24, 2026
Merged

ggreer merged 1 commit into
mainfrom
ggreer/bad-credential-test

Conversation

@ggreer

@ggreer ggreer commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Right now this test ignores connectors that return 1 (since that's the old behavior). We can correct that once we've made sure that connectors don't call os.Exit(1) when they get an error.

@ggreer

ggreer commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor Author

@ggreer
ggreer merged commit 4775fbf into main Aug 24, 2026
2 checks passed
@ggreer
ggreer deleted the ggreer/bad-credential-test branch August 24, 2026 23:01
agustin-conductor added a commit to ConductorOne/baton-salesforce that referenced this pull request Oct 14, 2026
The sync-test action's new Auth Error check (ConductorOne/github-workflows#110)
syncs with invalid credentials and expects the connector to exit with
Unauthenticated (16) or PermissionDenied (7). Token exchange failures were
plain errors, so the connector exited with Unknown (2).

Map rejected token requests (400/401 -> Unauthenticated, 403 ->
PermissionDenied) for both client credentials and JWT bearer flows.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
agustin-conductor added a commit to ConductorOne/baton-salesforce that referenced this pull request Oct 14, 2026
…uth status codes (#127)

* fix: migrate deprecated trait profile/status to resource-level attributes

baton-sdk v0.40.0 deprecated trait-level profile and status in favor of
attributes on Resource, which caused staticcheck SA1019 lint failures.

- users: move profile and status to WithResourceProfile/WithResourceStatus
- agents: move profile to WithResourceProfile
- tests: read profile via rs.GetProfile + GetProfileStringValue and status
  via rs.GetStatus instead of deprecated trait getters

C1's user uplift reads status via batonresource.GetStatus (resource-first),
so the SDK's trait-status ENABLED default does not affect disabled users.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore: remove unnecessary migration comments

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: return gRPC auth status codes on token exchange failure

The sync-test action's new Auth Error check (ConductorOne/github-workflows#110)
syncs with invalid credentials and expects the connector to exit with
Unauthenticated (16) or PermissionDenied (7). Token exchange failures were
plain errors, so the connector exited with Unknown (2).

Map rejected token requests (400/401 -> Unauthenticated, 403 ->
PermissionDenied) for both client credentials and JWT bearer flows.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: map remaining token endpoint statuses via uhttp.GrpcCodeFromHTTPStatus

429/5xx token exchange failures now return Unavailable (501 -> Unimplemented)
instead of falling through to Unknown, matching the SDK's HTTP-to-gRPC
convention. 400/401/403 keep their explicit auth mappings.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

2 participants