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

Clean up obtaining bearer tokens for registries #2480

Merged
merged 6 commits into from
Jul 11, 2024

Commits on Jul 9, 2024

  1. Beautify a test of newBearerTokenFromHTTPResponseBody

    Remove an unnecessary cast. Should not change (test) behavior.
    
    Signed-off-by: Miloslav Trmač <[email protected]>
    mtrmac committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    c132a17 View commit details
    Browse the repository at this point in the history
  2. Split the token storage type from the JSON representation

    We will want to add locks and more to the in-memory type;
    sharing that with JSON gets awkward, and an explicit separation
    between the externally-imposed structure and internal records
    is cleaner anyway.
    
    For now, just introduces a separate type with the same structure,
    should not change behavior.
    
    Signed-off-by: Miloslav Trmač <[email protected]>
    mtrmac committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    57d7e83 View commit details
    Browse the repository at this point in the history
  3. Make bearerToken.Token private

    No need to make it a public field now.
    
    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <[email protected]>
    mtrmac committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    dc3703b View commit details
    Browse the repository at this point in the history
  4. Add tests for bearerToken.expirationTime

    That's the value that really matters, not the inputs;
    and we will remove the inputs from bearerToken.
    
    Signed-off-by: Miloslav Trmač <[email protected]>
    mtrmac committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    1b7daaf View commit details
    Browse the repository at this point in the history
  5. Remove unnecessary fields from bearerToken

    These fields need to exist when parsing JSON; but we can just
    record the outcome of processing them.
    
    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <[email protected]>
    mtrmac committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    9b43674 View commit details
    Browse the repository at this point in the history
  6. Move newBearerTokenFromHTTPResponseBody closer to its callers

    Only moves unchanged code, should not change behavior.
    
    Signed-off-by: Miloslav Trmač <[email protected]>
    mtrmac committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    d6f4f35 View commit details
    Browse the repository at this point in the history