-
Notifications
You must be signed in to change notification settings - Fork 154
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
refactor: use struct types for claim related types #283
Conversation
dda419c
to
c217a72
Compare
Codecov Report
@@ Coverage Diff @@
## next #283 +/- ##
==========================================
+ Coverage 41.74% 46.52% +4.78%
==========================================
Files 83 74 -9
Lines 7254 5567 -1687
==========================================
- Hits 3028 2590 -438
+ Misses 3927 2748 -1179
+ Partials 299 229 -70
... and 10 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
a33086e
to
4585640
Compare
Created regression tests, based on |
7e45b7b
to
0abd772
Compare
TODO Write unit tests for functions:
Write unit tests for types (getters, setters):
Write Go doc with references to OpenID / Oauth2 on types:
|
5e4f882
to
cc395ed
Compare
this helps to verify that the same JSON is produced, after these types are refactored.
BREAKING change. The following types are changed from interface to struct type: - AccessTokenClaims - IDTokenClaims - IntrospectionResponse - UserInfo and related types. The following methods of OPStorage now take a pointer to a struct type, instead of an interface: - SetUserinfoFromScopes - SetUserinfoFromToken - SetIntrospectionFromToken The following functions are now generic, so that type-safe extension of Claims is now possible: - op.VerifyIDTokenHint - op.VerifyAccessToken - rp.VerifyTokens - rp.VerifyIDToken
- Changed UserInfoAddress to pointer in UserInfo and IntrospectionResponse. This was needed to make omitempty work correctly. - Copy or merge maps in IntrospectionResponse GetUserInfo and SetUserInfo
- Add get methods for Address fields to handle nil pointers as we used to
5cb4f89
to
d41f4b5
Compare
dcdbe6f
to
7b613c6
Compare
f02c2c5
to
ef5a8a2
Compare
WithIssuedAtMaxAge assigned its value to v.maxAge, which was wrong. This change fixes that by assiging the duration to v.maxAgeIAT.
- IDTokenClaims - IntrospectionResponse - UserInfo
4b7db85
to
c7f1319
Compare
🎉 This PR is included in version 2.0.0-next.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 2.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
JWTTokenRequest.GetIssuedAt() was returning the ExpiresAt field. This change corrects that by returning IssuedAt instead. This bug was introduced in #283
JWTTokenRequest.GetIssuedAt() was returning the ExpiresAt field. This change corrects that by returning IssuedAt instead. This bug was introduced in #283
JWTTokenRequest.GetIssuedAt() was returning the ExpiresAt field. This change corrects that by returning IssuedAt instead. This bug was introduced in #283
BREAKING change.
The following types are changed from interface to struct type:
The following methods of OPStorage now take a pointer to a struct type,
instead of an interface:
The following functions are now generic, so that type-safe extension
of Claims is now possible:
This is still a work in process. Need to create some regression tests and I want to verify if the current approach is what we want.