Skip to content

Call v2 IssueAgentToken and RegisterLicensedUser, fall back to v1 on 404 - #690

Merged
ArnobKumarSaha merged 1 commit into
masterfrom
arnob-v2-token
Nov 29, 2026
Merged

ArnobKumarSaha merged 1 commit into
masterfrom
arnob-v2-token

Conversation

@ArnobKumarSaha

Copy link
Copy Markdown
Member

Follow-up to #689. In IAM v2_only mode b3 does not mount the Mirrored v1 routes these two methods called, so both got 404.

Method v1 (404 in v2_only) v2 Connect procedure
GetToken GET /api/v1/agent/:name/:uid/token akp.inbox.v2.AgentService/IssueAgentToken
GetAuditTokenForCluster POST /api/v1/register akp.contract.v2.LicenseService/RegisterLicensedUser
  • Connect, because both RPCs are REST-forbidden in b3.
  • v1 fallback on 404 keeps older / v1_only platforms working.
  • RegisterLicensedUser takes features as a list (info.ParseFeatures) and returns natsServers. v1's natsServer was addrs[0] of the same list, so natsServers[0] is used. An empty list is an error.
  • do() takes the resource so errors name inboxtokenrequests / audittokenrequests. The v1 token path now goes through do(), so a non-200 response is an error instead of an empty token.

Caveat (same as #689): a v2 not_found from the handler is also HTTP 404 and triggers the v1 fallback.

Not yet tested against a live v2_only platform.

Signed-off-by: Arnob kumar saha <arnob@appscode.com>
@ArnobKumarSaha
ArnobKumarSaha merged commit c5774cc into master Nov 29, 2026
7 checks passed
@ArnobKumarSaha
ArnobKumarSaha deleted the arnob-v2-token branch November 29, 2026 10:59
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.

1 participant