Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add CanSetUserinfoFromRequest interface #322

Closed
wants to merge 1 commit into from

Conversation

muir
Copy link
Contributor

@muir muir commented Mar 11, 2023

To support adding session-related claims (like a session id) to IDTokens, I've added a new (optional) add-on interface to Storage:

// CanSetUserinfoFromRequest is an optional additional interface that may be implemented by
// implementors of Storage.  It allows additional data to be set in id_tokens based on the
// request.
type CanSetUserinfoFromRequest interface {
	SetUserinfoFromRequest(ctx context.Context, userinfo oidc.UserInfoSetter, request IDTokenRequest, scopes []string) error
}

For the next branch, we can simply add request IDTokenRequest as an additional parameter to SetUserinfoFromScopes

@codecov
Copy link

codecov bot commented Mar 11, 2023

Codecov Report

Merging #322 (e56925a) into main (eea2ed1) will increase coverage by 0.02%.
The diff coverage is 57.14%.

@@            Coverage Diff             @@
##             main     #322      +/-   ##
==========================================
+ Coverage   39.63%   39.65%   +0.02%     
==========================================
  Files          74       74              
  Lines        5965     5972       +7     
==========================================
+ Hits         2364     2368       +4     
- Misses       3350     3352       +2     
- Partials      251      252       +1     
Impacted Files Coverage Δ
pkg/op/token.go 64.10% <40.00%> (-1.08%) ⬇️
example/server/storage/storage.go 60.86% <100.00%> (+0.20%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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