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

fix(primera-restapi): retry authentication when the token is invalid #5267

Conversation

omercier
Copy link
Contributor

@omercier omercier commented Oct 31, 2024

Description

Source #5256
Refs: CTOR-1032

PS: Thanks @rmorandell-pgum!

Type of change

  • Patch fixing an issue (non-breaking change)
  • New functionality (non-breaking change)
  • Functionality enhancement or optimization (non-breaking change)
  • Breaking change (patch or feature) that might cause side effects breaking part of the Software

How this pull request can be tested ?

Robot tests still working.

Checklist

  • I have followed the coding style guidelines provided by Centreon
  • I have commented my code, especially hard-to-understand areas of the PR.
  • I have rebased my development branch on the base branch (develop).
  • In case of a new plugin, I have created the new packaging directory accordingly.
  • I have implemented automated tests related to my commits.
  • I have reviewed all the help messages in all the .pm files I have modified.
    • All sentences begin with a capital letter.
    • All sentences are terminated by a period.
    • I am able to understand all the help messages, if not, exchange with the PO or TW to rewrite them.
  • After having created the PR, I will make sure that all the tests provided in this PR have run and passed.

rmorandell-pgum and others added 2 commits October 31, 2024 17:15
- The unknown, critical & warning status is not se for the general API HTTP request. They are only set on login. So when token in the statefile is not more valid (because retired) the other checks doesn't terminate before validating data
- During a firmware upgrade the token saved in the statefile will not be valid anymore even it should by validation date. In this case the user must find the statefile an delete it to force a new login. With a simple clean of the token and a retry we can retry ones with a new login
@omercier omercier marked this pull request as ready for review October 31, 2024 16:33
@omercier omercier requested a review from a team as a code owner October 31, 2024 16:33
@omercier omercier changed the title Ctor 1032 plugin storage hp primera restapi custom api http status handling retry on invalid token fix(primera-restapi): retry authentication when the token is invalid Oct 31, 2024
@omercier omercier merged commit 790c96d into develop Oct 31, 2024
23 checks passed
@omercier omercier deleted the CTOR-1032-Plugin-storage-hp-primera-restapi-Custom-api-HTTP-status-handling-retry-on-invalid-token branch October 31, 2024 16:46
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