Skip to content

fix(core): admit org-less endpoints under Bedrock identity enforcement - #145

Open
minekube-ai-engineer[bot] wants to merge 1 commit into
mainfrom
fix/bedrock-orgless-endpoint-scope
Open

fix(core): admit org-less endpoints under Bedrock identity enforcement#145
minekube-ai-engineer[bot] wants to merge 1 commit into
mainfrom
fix/bedrock-orgless-endpoint-scope

Conversation

@minekube-ai-engineer

Copy link
Copy Markdown

Problem

The Connect Java plugin's Bedrock identity enforcement still requires an organization on the identity scope, reproducing the same gap moxy #544 removes on the edge side.

An endpoint without an organization parent is a first-class endpoint-scoped identity scope: the signed envelope binds to the endpoint itself (globally unique id), and the org dimension is optional. Requiring an org meant:

  • BedrockIdentityVerifier.validate rejected envelopes with an empty org_id ("identity envelope endpoint scope is incomplete").
  • The verifier builder threw IllegalArgumentException: orgId is required when configured with an empty org (.orgId("")).
  • BedrockIdentityEnforcer rejected org-less endpoints under enforcement: require ("authenticated endpoint scope is incomplete") — the default is warn, so today it only logs, but strict-mode users were blocked.

Support case: gurtville — a Connect-plugin user with an org-less endpoint got scope_unavailable on Bedrock join. The owner should never need to claim/import the endpoint into a dashboard organization just to enable Bedrock.

Change

  • BedrockIdentityVerifier: the envelope endpoint scope requires only id + name; org_id may be empty. The configured org is now optional-empty (optionalNullOrEmpty) — an empty value means "no org constraint", matching the scope check that already only compared org when non-null.
  • BedrockIdentityEnforcer: the scope-completeness pre-check requires only the endpoint id; a missing org no longer rejects under require mode.

Verification (TDD)

  • RED first: verifiesEndpointScopedBedrockXuidEnvelopeWithoutOrg failed with orgId is required (builder throw); requireModeAllowsOrglessEndpointScope failed with allowed=false (enforcer reject).
  • Both pass after the change; full :core:test :api:test suite green (340+ tests; the one pre-existing environmental failure — ReleaseAssetVerificationTest needing jq — passes once jq is present).
  • Pairs with moxy #544 (edge-side endpoint-scoped identity scope).

An endpoint without an organization parent is a first-class endpoint-scoped
identity scope: the envelope binds to the endpoint itself and the org
dimension is optional (moxy GeyserMC#544, support case: gurtville scope_unavailable).

- BedrockIdentityVerifier no longer requires a non-empty org_id in the
  envelope endpoint scope, and treats an empty configured org as no org
  constraint (optionalNullOrEmpty) instead of throwing.
- BedrockIdentityEnforcer only requires the endpoint id for scope
  completeness; a missing org no longer rejects under require-mode
  enforcement.
- TDD: org-less envelope verify + require-mode enforcer tests failed on the
  unfixed code (orgId is required / allowed=false) and pass after.
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.

0 participants