(token string)
| 32 | } |
| 33 | |
| 34 | func (c *CachedIdentityService) VerifyToken(token string) (schema.Authorization, error) { |
| 35 | i, ok := c.cache.Get(token) |
| 36 | if ok { |
| 37 | return i.(schema.Authorization), nil |
| 38 | } |
| 39 | a, err := c.inner.VerifyToken(token) |
| 40 | if err != nil { |
| 41 | return nil, err |
| 42 | } |
| 43 | c.cache.Set(token, a, cache.DefaultExpiration) |
| 44 | return a, nil |
| 45 | } |
| 46 | |
| 47 | func (c *CachedIdentityService) GetServiceAuthorization() (schema.Authorization, error) { |
| 48 | return c.VerifyToken(c.GetClient().TokenID) |
no test coverage detected