Skip to content

feat(rest): add audience and resource params to OAuth requests#815

Open
lovromazgon wants to merge 1 commit intoapache:mainfrom
lovromazgon:lovro/oauth-aud-resource
Open

feat(rest): add audience and resource params to OAuth requests#815
lovromazgon wants to merge 1 commit intoapache:mainfrom
lovromazgon:lovro/oauth-aud-resource

Conversation

@lovromazgon
Copy link
Copy Markdown
Contributor

  • Add WithAudience and WithResource options to the REST catalog client
  • These are forwarded as form parameters in OAuth2 token requests, per RFC 8707 and RFC 8693
  • Refactor TestScope into a table-driven TestOAuthTokenRequestParams covering scope, audience, and resource combinations

The Iceberg REST spec allows audience and resource as OAuth token
request parameters. Wire these through via WithAudience/WithResource
options and clientcredentials.Config.EndpointParams
Comment on lines +118 to +128
func WithAudience(audience string) Option {
return func(o *options) {
o.audience = audience
}
}

func WithResource(resource string) Option {
return func(o *options) {
o.resource = resource
}
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just add some docstring comments for these please. Otherwise this looks good to me!

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