Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add header for reauth purposes #155

Closed
wants to merge 3 commits into from
Closed

Add header for reauth purposes #155

wants to merge 3 commits into from

Conversation

jesusbv
Copy link
Contributor

@jesusbv jesusbv commented Apr 19, 2024

  • When refreshing the credentials server side, add a header to explicitly set the registry cache file

- When refreshing the credentials server side,
  add a header to explicitly set the cache
@jesusbv jesusbv self-assigned this Apr 19, 2024
Copy link
Contributor

@schaefi schaefi left a comment

Choose a reason for hiding this comment

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

Just nitpick on the test, the code looks good to me 👍

I'm missing details about the motivation of the new header field as well as where it's been used or what consumes it. I guess this information is in some other API documentation ? I again reviewed only in terms of code not in terms of functionality as a whole

@rjschwei
Copy link
Contributor

On the server side we, i.e. people working on the registry as part of RMT project have currently 2 PRs pending, SUSE/rmt#1124 and SUSE/rmt#1128. As commented in 1128 I do not understand the need for it given 1124. Also X-Registry is too generic.

My understanding based on 1124 in the RMT project is as follows:

When the client, docker or podman, come to visit they will send a token. The code in 1124 will check if the last_seen_at time is more then 8 hours ago and if so the token will be rejected. Thus access is denied, meaning the user has to re-auth. When the activation() function is called the system via the repository path will not be in the cache and therefore a full verification will take place. This will update last_seen_at and thus the next access of the registry if it is less than 8 hours later will work.

Meaning this change is not needed.

@jesusbv
Copy link
Contributor Author

jesusbv commented Apr 24, 2024

On the server side we, i.e. people working on the registry as part of RMT project have currently 2 PRs pending, SUSE/rmt#1124 and SUSE/rmt#1128. As commented in 1128 I do not understand the need for it given 1124. Also X-Registry is too generic.

My understanding based on 1124 in the RMT project is as follows:

When the client, docker or podman, come to visit they will send a token. The code in 1124 will check if the last_seen_at time is more then 8 hours ago and if so the token will be rejected. Thus access is denied, meaning the user has to re-auth. When the activation() function is called the system via the repository path will not be in the cache and therefore a full verification will take place. This will update last_seen_at and thus the next access of the registry if it is less than 8 hours later will work.

Meaning this change is not needed.

I understood that the behavior on 1124 was correct until

The idea is to expire the token after 8 hours no matter how often the system comes to visit in those 8 hours

meaning we would need to force a reauth, depending on that comment or, in other words, whether we are OK having the expiration of the access updated by any access of zypper (again, I understood we are OK with that but the comment states different behavior) then this PR would be needed or not

@jesusbv
Copy link
Contributor Author

jesusbv commented Apr 24, 2024

Clarified that last_seen_at is enough for granting access to the registry, we do not need this change

@jesusbv jesusbv closed this Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants