Repository navigation
Sync test: Add test to ensure that a connector bad credentials returns the correct GRPC status. - #110
Merged
Merged
Conversation
…s the correct GRPC status.
Contributor
Author
jugonzalez12
approved these changes
Aug 24, 2026
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.