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

Support endpoint for refreshing auth token #14

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

hmpf
Copy link
Contributor

@hmpf hmpf commented Dec 9, 2024

The token will be regenerated and a new expiration date will be set, so it is necessary to rebuild the client with the new token afterwards.

The endpoint only exists in version 2 of the API though.

@hmpf hmpf requested a review from lunkwill42 December 9, 2024 12:42
@hmpf hmpf self-assigned this Dec 9, 2024
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Copy link
Member

@lunkwill42 lunkwill42 left a comment

Choose a reason for hiding this comment

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

The implementation here is straightforward and there's not much to say about it.

But let's bikeshed some naming, shall we? ;-)

Where in the public API is the term Knox mentioned? I perceive this to be the name of a library used by the Argus server, and is as such an internal implementation detail of the server. I therefore don't see why it has any bearing on how things are named in the API client.

The client library has no support for any pre-existing token endpoints, so I don't see any need to differentiate naming from something that didn't exist. If we add more token solutions to the Argus server, then the problem of differentiating different solutions is an Argus server problem first and foremost.

I would simply call this an "Opaque API token" - and also add a proper docstring to the resource function to explain what the API call actually means for the client.

src/pyargus/client.py Outdated Show resolved Hide resolved
@hmpf hmpf requested a review from lunkwill42 December 10, 2024 10:00
Copy link
Member

@lunkwill42 lunkwill42 left a comment

Choose a reason for hiding this comment

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

I like the alternative name. This approval is pending that we get the tests to run properly (i.e. we need to fix #15 and rebase this).

src/pyargus/client.py Show resolved Hide resolved
@hmpf hmpf force-pushed the support-token-refresh branch from 6667967 to 8687da0 Compare December 10, 2024 10:29
@hmpf
Copy link
Contributor Author

hmpf commented Dec 10, 2024

I'll add some docs to README, hold your horses

Copy link
Member

@lunkwill42 lunkwill42 left a comment

Choose a reason for hiding this comment

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

Minimal typos detected. Last minute stress changes are always a bitch, eh? ;)

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
The token will be regenerated and a new expiration date will be set, so
it is necessary to rebuild the client with the new token afterwards.
This is documented in the README and as a doc string on the
`refresh_token` client method.
@hmpf hmpf force-pushed the support-token-refresh branch from 6268e20 to c64e4ce Compare December 10, 2024 11:30
@lunkwill42 lunkwill42 merged commit 562c93d into Uninett:master Dec 10, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants