zalando-stups / planb-tokeninfo

Plan B Token Info service for JWT tokens
http://planb.readthedocs.org/
Other
17 stars 8 forks source link

#72 Support for custom JwtProcessors #73

Closed vroldanbet closed 7 years ago

vroldanbet commented 7 years ago

Initial PR for review. Some constants/defaults could be still be subject to change.

vroldanbet commented 7 years ago

@lmineiro thanks for your comments. I could think of a plugin system that allows introducing custom processors depending on the issuer claim, but it is not clear to me how to set such a plugin system in Golang. Do you have some ideas to share on this topic?

codecov-io commented 7 years ago

Current coverage is 95.24% (diff: 86.66%)

Merging #73 into master will decrease coverage by 0.11%

@@             master        #73   diff @@
==========================================
  Files            22         22          
  Lines          1035       1052    +17   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits            987       1002    +15   
- Misses           37         38     +1   
- Partials         11         12     +1   

Powered by Codecov. Last update b0cbc73...98df6cb

vroldanbet commented 7 years ago

@lmineiro @hjacobs @Raffo @szuecs reworked this. Now exposing a JwtProcessor interface that can be injected via options, and introduced runner package, so that tokeninfo bootstrap logic can be reused.

vroldanbet commented 7 years ago

@szuecs refactored JwtProcessor and TokenInfo into its own module, and replaced options with "interface" to use the actual "JwtProcessor" interface.

szuecs commented 7 years ago

From my side it's ok. @lmineiro any opinions from you?

lmineiro commented 7 years ago

👍

vroldanbet commented 7 years ago

@lmineiro @szuecs added token masking function, takes only the signature of JWT, otherwise returns empty string (non-jwt do not reach this part of the code, anyway)

lmineiro commented 7 years ago

lgtm

vroldanbet commented 7 years ago

:+1: