|
Ran
|
Files
87
|
Run time
4s
|
Badge
README BADGES
|
push
travis-ci
store oauth tokens per client app as sorted set, new endpoint to get … (#1465) changes for https://github.com/TykTechnologies/tyk-analytics/issues/533 - store in Redis list of tokens per oauth-client with using sorted set - use token expire date as a score so we can request range of tokens not expired as for now - remove range with already expired tokens to free up space for other keys - having token list stored as a sorted set we can easily add pagination if required (just moving range for pages) - also, added new endpoint `GET /oauth/clients/{apiID}/{keyName}/tokens` to get list of not expired tokens per API and oauth-client reply format example: ``` [ { "code": "5a7d110be87f52f87a80d2496", "expires": 1518158407 }, { "code": "5a7d110beba7979c6c51d6dbd", "expires": 1518158594 }, { "code": "5a7d110bea7d585bff291fec4", "expires": 1518158638 }, { "code": "5a7d110be8065a106ef45af54", "expires": 1518159792 } ] ``` - new config key `oauth_token_expired_retain_period ` to specify retain period for expired tokens stored in redis sorted sets - test for new endpoint `GET /oauth/clients/{apiID}/{keyName}/tokens` - added changes to make api ID optional in `POST /oauth/clients/create` - these changes make endpoint more generic, if we provide API ID it works the same it was before, if we don't provide API ID it uses policy's access rights and enumerates APIs from there setting the same newly created oauth-client I've tested it with case when we have requested oauth-client for some policy ID which contains several APIs - after request got approved we can get tokens for any API from that policy using the same oauth client credentials
7912 of 14399 relevant lines covered (54.95%)
0.61 hits per line
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|