• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

TykTechnologies / tyk / 4335 / 1

Build:
DEFAULT BRANCH: master
Ran 07 Mar 2018 02:19PM UTC
Files 87
Run time 4s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

07 Mar 2018 02:13PM UTC coverage: 54.948% (-0.2%) from 55.128%
LATEST_GO=true

push

travis-ci

buger
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

Source Files on job 4335.1 (LATEST_GO=true)
  • Tree
  • List 0
  • Changed 7
  • Source Changed 6
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 1
  • Travis Job 4335.1
  • 26e22940 on github
  • Prev Job for LATEST_GO=true on master (#4334.1)
  • Next Job for LATEST_GO=true on master (#4338.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc