Skip to content

Delete Me#100

Closed
johnallers wants to merge 2 commits intomainfrom
jallers/abebars/feat/single-hop-assume-role
Closed

Delete Me#100
johnallers wants to merge 2 commits intomainfrom
jallers/abebars/feat/single-hop-assume-role

Conversation

@johnallers
Copy link
Contributor

@johnallers johnallers commented Jan 30, 2026

  • feat(config): add single-hop assume role support for self-hosted deployments
  • feat(connector): add single-hop assume role for self-hosted deployments

Summary by CodeRabbit

  • Bug Fixes

    • Removed redundant validation logic in configuration validation.
  • New Features

    • Added support for direct role assumption workflow, enabling simplified authentication in single-hop mode.
  • Improvements

    • Optimized validation flow to only validate external credentials when required in multi-hop scenarios.

✏️ Tip: You can customize this high-level summary in your review settings.

abebars and others added 2 commits January 29, 2026 22:06
…oyments

When use-assume is set with role-arn but WITHOUT global-role-arn, the
connector now performs single-hop assume role (IRSA -> target role).

This supports self-hosted deployments (e.g., EKS with IRSA) that don't
need an intermediate binding account.

Changes:
- external-id is only required for two-hop mode (when global-role-arn is set)
- Dockerfile uses correct binary name (baton-aws)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
When globalRoleARN is empty but roleARN is set, assume directly into
the target role without an intermediate binding account hop.

This enables self-hosted deployments (e.g., EKS with IRSA) to use
assume role without needing ConductorOne's binding account flow.

Co-Authored-By: Claude <noreply@anthropic.com>
@johnallers johnallers requested a review from a team January 30, 2026 15:34
@coderabbitai
Copy link

coderabbitai bot commented Jan 30, 2026

Walkthrough

The changes refactor validation logic in the config module while introducing a single-hop assume-role path in the connector. When globalRoleARN is empty and roleARN is set, the system now directly assumes the specified role via STS; otherwise, it maintains the existing two-hop flow. Validation is reordered to check Role ARN first, with ExternalID validation only performed in two-hop mode.

Changes

Cohort / File(s) Summary
Configuration validation refactoring
pkg/config/config.go
Reordered validation to check Role ARN first using IsValidRoleARN. External-ID validation now occurs only when globalRoleARN is set (two-hop mode). Removed ExternalIdField from UseAssumeField dependency constraint, leaving only RoleArnField as dependent. Eliminated redundant Role ARN validation.
Single-hop assume-role path
pkg/connector/connector.go
Added new conditional flow in getCallingConfig: when globalRoleARN is empty and roleARN is set, directly assumes into roleARN using STS with optional ExternalID, caches credentials, and returns Config. Includes debug logging and error handling. Existing two-hop flow remains unchanged.

Sequence Diagram(s)

sequenceDiagram
    participant Code as Application Code
    participant Connector as Connector Logic
    participant STS as AWS STS
    participant Cache as Credentials Cache
    
    Code->>Connector: getCallingConfig(roleARN, externalID, globalRoleARN)
    
    alt Single-Hop Mode (globalRoleARN empty)
        Connector->>STS: AssumeRole(roleARN, externalID)
        STS-->>Connector: Credentials
        Connector->>Cache: Store credentials
        Connector-->>Code: Config with assumed credentials
    else Two-Hop Mode (globalRoleARN set)
        Connector->>STS: AssumeRole(globalRoleARN)
        STS-->>Connector: Intermediate credentials
        Connector->>STS: AssumeRole(roleARN, externalID)
        STS-->>Connector: Final credentials
        Connector->>Cache: Store credentials
        Connector-->>Code: Config with final credentials
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Through binding accounts we once did hop,
Now single steps reach the mountain top!
ARNs validated first, then IDs when needed,
Two paths converge, both paths succeeded!
Configuration flows, credentials dance,
Assume-role takes its rightful chance. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'Delete Me' is generic and unrelated to the actual changeset, which implements single-hop assume-role support for AWS self-hosted deployments. Replace the title with a descriptive summary of the main change, such as 'Add single-hop assume-role support for self-hosted deployments' or similar.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jallers/abebars/feat/single-hop-assume-role

Tip

🧪 Unit Test Generation v2 is now available!

We have significantly improved our unit test generation capabilities.

To enable: Add this to your .coderabbit.yaml configuration:

reviews:
  finishing_touches:
    unit_tests:
      enabled: true

Try it out by using the @coderabbitai generate unit tests command on your code files or under ✨ Finishing Touches on the walkthrough!

Have feedback? Share your thoughts on our Discord thread!


Comment @coderabbitai help to get the list of available commands and usage tips.

@johnallers johnallers closed this Jan 30, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@pkg/config/config.go`:
- Around line 118-129: The code currently validates RoleArn via
connector.IsValidRoleARN but doesn't validate GlobalRoleArn; update the
validation flow in the same block to call connector.IsValidRoleARN on
awsc.GetString(GlobalRoleArnField.FieldName) (similar to RoleArnField) before
running ValidateExternalId, and return the error if that call fails; keep
ValidateExternalId(awsc.GetString(ExternalIdField.FieldName)) only for the
two-hop case when globalRoleArn != "".

Comment on lines +118 to +129
err := connector.IsValidRoleARN(awsc.GetString(RoleArnField.FieldName))
if err != nil {
return err
}
err = connector.IsValidRoleARN(awsc.GetString(RoleArnField.FieldName))
if err != nil {
return err
// Only validate external-id for two-hop mode (when global-role-arn is set)
// Single-hop mode (IRSA → target role) doesn't require external-id
globalRoleArn := awsc.GetString(GlobalRoleArnField.FieldName)
if globalRoleArn != "" {
err = ValidateExternalId(awsc.GetString(ExternalIdField.FieldName))
if err != nil {
return err
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Validate global-role-arn when provided.

Right now an invalid global-role-arn can pass validation and only fail later during STS calls. Consider validating it alongside role-arn before external-id checks.

🔧 Proposed fix
 		err := connector.IsValidRoleARN(awsc.GetString(RoleArnField.FieldName))
 		if err != nil {
 			return err
 		}
 		// Only validate external-id for two-hop mode (when global-role-arn is set)
 		// Single-hop mode (IRSA → target role) doesn't require external-id
 		globalRoleArn := awsc.GetString(GlobalRoleArnField.FieldName)
 		if globalRoleArn != "" {
-			err = ValidateExternalId(awsc.GetString(ExternalIdField.FieldName))
-			if err != nil {
-				return err
-			}
+			if err := connector.IsValidRoleARN(globalRoleArn); err != nil {
+				return err
+			}
+			if err := ValidateExternalId(awsc.GetString(ExternalIdField.FieldName)); err != nil {
+				return err
+			}
 		}
🤖 Prompt for AI Agents
In `@pkg/config/config.go` around lines 118 - 129, The code currently validates
RoleArn via connector.IsValidRoleARN but doesn't validate GlobalRoleArn; update
the validation flow in the same block to call connector.IsValidRoleARN on
awsc.GetString(GlobalRoleArnField.FieldName) (similar to RoleArnField) before
running ValidateExternalId, and return the error if that call fails; keep
ValidateExternalId(awsc.GetString(ExternalIdField.FieldName)) only for the
two-hop case when globalRoleArn != "".

@johnallers johnallers deleted the jallers/abebars/feat/single-hop-assume-role branch February 2, 2026 18:11
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