Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Support force_pull for /api/token when retrieving cluster tokens #351

Merged
merged 1 commit into from
Feb 27, 2018

Conversation

alexeykazakov
Copy link
Contributor

Currently we support force_pull param in /api/token?for=<oso_resource> endpoint when retrieving user OSO tokens.
This PR also adds support of the same force_pull param for cluster tokens too. Not only for user tokens.
When force_pull=true the auth service will load the user profile using the stored dsaas user token. It will return 401 if the token is not valid and rejected by OSO.

Required for openshiftio/openshift.io#2304

@fabric8cd
Copy link

@alexeykazakov snapshot fabric8-auth image is available for testing. docker pull docker.io/fabric8/fabric8-auth:SNAPSHOT-PR-351-1

@codecov
Copy link

codecov bot commented Feb 27, 2018

Codecov Report

Merging #351 into master will increase coverage by 0.13%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #351      +/-   ##
==========================================
+ Coverage   55.45%   55.59%   +0.13%     
==========================================
  Files          71       71              
  Lines        6971     6992      +21     
==========================================
+ Hits         3866     3887      +21     
  Misses       2788     2788              
  Partials      317      317
Impacted Files Coverage Δ
token/link/link.go 61.2% <ø> (ø) ⬆️
token/link/openshift.go 69.44% <100%> (+1.79%) ⬆️
controller/token.go 66.8% <100%> (+1.38%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 01b01ca...68155d3. Read the comment docs.

"for": forResource,
"configuration_username": osConfig.OSOCluster().ServiceAccountUsername,
"user_profile_username": userProfile.Username,
}, "username from user profile for cluster token does not match username stored in configuration")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is going to be a tricky situation, if this ever happens :)

@sbose78 sbose78 merged commit 7a2320f into fabric8-services:master Feb 27, 2018
@alexeykazakov alexeykazakov deleted the forcePull branch February 27, 2018 15:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants