Skip to content

feat(auth): add support for new service version in VPC Instant Auth#273

Open
pyrooka wants to merge 3 commits into
mainfrom
nb/vpc-auth-extension
Open

feat(auth): add support for new service version in VPC Instant Auth#273
pyrooka wants to merge 3 commits into
mainfrom
nb/vpc-auth-extension

Conversation

@pyrooka
Copy link
Copy Markdown
Member

@pyrooka pyrooka commented Jun 3, 2026

This PR adds support for the new VPC Instance Metadata Service version (2025-08-26) with the following changes:

  • Added configurable ServiceVersion field (default: "2022-03-01") that switches to new API paths (/identity/v1/token, /identity/v1/iam_tokens) when set to "2025-08-26"
  • Added TokenLifetime field (default: 300s) for customizable token expiration
  • Configuration via builder methods (SetServiceVersion(), SetTokenLifetime()) or VPC_IMS_VERSION environment variable
  • Full backward compatibility with older service versions

In this commit we fix an issue where
the golangci-lint would fail.

Signed-off-by: András Felleg <afelleg@gmail.com>
@pyrooka pyrooka force-pushed the nb/vpc-auth-extension branch from 88ccf93 to 2ed3c94 Compare June 3, 2026 11:05
pyrooka added 2 commits June 3, 2026 13:43
Signed-off-by: Norbert Biczo <pyrooka@users.noreply.github.com>
Signed-off-by: Norbert Biczo <pyrooka@users.noreply.github.com>
@pyrooka pyrooka force-pushed the nb/vpc-auth-extension branch from 2ed3c94 to a37baf5 Compare June 3, 2026 11:46
@pyrooka pyrooka marked this pull request as ready for review June 3, 2026 11:52
}

// getCreateAccessTokenPath returns the operation path for creating an access token based on the service version.
func (authenticator *VpcInstanceAuthenticator) getCreateAccessTokenPath() string {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What if the version is greater than 2025-08-26 ?

The latest ones use the new endpoints

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Image

}

// Set the params and request body.
builder.AddQuery("version", vpcauthMetadataServiceVersion)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
builder.AddQuery("version", authenticator.serviceVersion())

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.

3 participants