Skip to content

Clean up obtaining bearer tokens for registries#2480

Merged
rhatdan merged 6 commits into
containers:mainfrom
mtrmac:token-cleanup
Jul 11, 2024
Merged

Clean up obtaining bearer tokens for registries#2480
rhatdan merged 6 commits into
containers:mainfrom
mtrmac:token-cleanup

Conversation

@mtrmac

@mtrmac mtrmac commented Jul 9, 2024

Copy link
Copy Markdown
Collaborator

This is a few refactors currently living in #1968, split for separate review and merging — without the substance of that feature.

The net effect of this PR is to decrease memory requirements a tiny bit, and to add make tests a tiny bit more relevant and decoupled.

See individual commit messages for details.

mtrmac added 6 commits July 9, 2024 22:32
Remove an unnecessary cast. Should not change (test) behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
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č <mitr@redhat.com>
No need to make it a public field now.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
That's the value that really matters, not the inputs;
and we will remove the inputs from bearerToken.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
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č <mitr@redhat.com>
Only moves unchanged code, should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
@rhatdan

rhatdan commented Jul 11, 2024

Copy link
Copy Markdown
Member

LGTM
@giuseppe PTAL

@giuseppe giuseppe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@rhatdan rhatdan merged commit 2416f89 into containers:main Jul 11, 2024
@mtrmac mtrmac deleted the token-cleanup branch July 11, 2024 14:01
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.

3 participants