Skip to content

[GT-184] Add support for renewing API credentials - #464

Merged
gregcorbett merged 7 commits into
GOCDB:devfrom
Sae126V:GT-184-Extend-API-Credential-Management-to-handle-periodic-renewal
Aug 4, 2026
Merged

[GT-184] Add support for renewing API credentials#464
gregcorbett merged 7 commits into
GOCDB:devfrom
Sae126V:GT-184-Extend-API-Credential-Management-to-handle-periodic-renewal

Conversation

@Sae126V

@Sae126V Sae126V commented Aug 4, 2023

Copy link
Copy Markdown
Contributor

Resolves

" #438 and #453 "

@Sae126V
Sae126V force-pushed the GT-184-Extend-API-Credential-Management-to-handle-periodic-renewal branch 3 times, most recently from 5728cd9 to 6f26459 Compare August 7, 2023 07:52
@Sae126V
Sae126V marked this pull request as ready for review August 7, 2023 07:55
@Sae126V
Sae126V requested a review from a team as a code owner August 7, 2023 07:55
Comment thread htdocs/web_portal/views/site/edit_api_auth.php Outdated
Comment thread htdocs/web_portal/views/site/edit_api_auth.php Outdated
Comment thread htdocs/web_portal/views/site/edit_api_auth.php Outdated
Comment thread htdocs/web_portal/views/site/edit_api_auth.php Outdated
Comment thread htdocs/web_portal/views/site/edited_api_auth.php Outdated
Comment thread htdocs/web_portal/views/site/view_site.php Outdated
Comment thread lib/Gocdb_Services/APIAuthenticationService.php Outdated
Comment thread htdocs/web_portal/views/site/view_site.php Outdated
Comment thread lib/Gocdb_Services/APIAuthenticationService.php
Comment thread lib/Gocdb_Services/Site.php Outdated
Comment thread resources/ManageAPICredentials/ManageUnusedAPICredentialsOptions.php Outdated
Comment thread resources/ManageAPICredentials/ManageAPICredentialsActions.php Outdated
@Sae126V
Sae126V marked this pull request as draft August 18, 2023 14:37
@Sae126V
Sae126V force-pushed the GT-184-Extend-API-Credential-Management-to-handle-periodic-renewal branch from bc37f58 to 6259cc5 Compare August 18, 2023 14:50
@Sae126V
Sae126V marked this pull request as ready for review August 18, 2023 14:51
Comment thread htdocs/web_portal/controllers/site/edit_api_auth.php Outdated
@Sae126V
Sae126V marked this pull request as draft September 11, 2023 08:32
@Sae126V
Sae126V force-pushed the GT-184-Extend-API-Credential-Management-to-handle-periodic-renewal branch from 8afb986 to cd82c9e Compare September 13, 2023 07:54
@Sae126V

Sae126V commented Sep 13, 2023

Copy link
Copy Markdown
Contributor Author

@gregcorbett , This is ready for the functionality review.

@Sae126V
Sae126V marked this pull request as ready for review September 13, 2023 07:55

@gregcorbett gregcorbett 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.

Functionality looks good. I noticed that when emails were generated for both unrenewed and inactive API credentitals, I got:

> php resources/ManageAPICredentials/ManageUnusedAPICredentials.php --warning_threshold 9 --deletion_threshold 15 --renewals
...
The API credential associated with the following identifier
registered at site X has not been renewed for
the last 0 months and will be deleted if it reaches 15 months.

Where 0 should have been closer to 12, which is why the warning email was generated. Could you look into that?

@gregcorbett

Copy link
Copy Markdown
Member

Could you also add printing out the last renewed time to reportDryRun?

@Sae126V

Sae126V commented Sep 14, 2023

Copy link
Copy Markdown
Contributor Author

Could you also add printing out the last renewed time to reportDryRun?

Sure, Greg. Added the support for last renewed time in 0d1ec9a

@Sae126V
Sae126V marked this pull request as draft September 14, 2023 09:35
@Sae126V

Sae126V commented Sep 14, 2023

Copy link
Copy Markdown
Contributor Author

Ready for the functionality review with the fix and suggestions @gregcorbett.

@Sae126V
Sae126V marked this pull request as ready for review September 14, 2023 14:07
Sae126V added a commit to Sae126V/gocdb that referenced this pull request Sep 19, 2023
Sae126V added a commit to Sae126V/gocdb that referenced this pull request Sep 19, 2023
Sae126V added a commit to Sae126V/gocdb that referenced this pull request Sep 20, 2023
Sae126V added a commit to Sae126V/gocdb that referenced this pull request Sep 20, 2023
@Sae126V
Sae126V force-pushed the GT-184-Extend-API-Credential-Management-to-handle-periodic-renewal branch from 61d1865 to 0577fbc Compare July 14, 2026 12:12
Comment thread lib/Gocdb_Services/APIAuthenticationService.php
@gregcorbett

Copy link
Copy Markdown
Member

@Sae126V , can you remember why lib/Gocdb_Services/APIAuthenticationService.php is being touched?

Was it to support being able to renew (and hence take ownership of, if necessary) a credential without otherwise editing it (i.e. a renew button in the portal)? If so, I wonder if there is a version of this change that doesn't touch lib/Gocdb_Services/APIAuthenticationService.php... can you investigate?

@Sae126V

Sae126V commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@Sae126V , can you remember why lib/Gocdb_Services/APIAuthenticationService.php is being touched?

Yep, so, it was changed to support the renew button. The problem is that a renewal doesn't send any form fields (the point of "renew without otherwise editing it"), but the existing editAPIAuthentication() expects them.

I'll investigate whether there's a version that doesn't touch this file and get back to you by tomorrow

@gregcorbett

Copy link
Copy Markdown
Member

The problem is that a renewal doesn't send any form fields

Presumably we could just send the current values into editAPIAuthentication()?

@Sae126V
Sae126V force-pushed the GT-184-Extend-API-Credential-Management-to-handle-periodic-renewal branch from a7d8e3d to e123f64 Compare July 24, 2026 08:40
@Sae126V

Sae126V commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

I have changed the logic of renewal flow. This would be now separate from the editing user flow. Ready for the review now

Comment thread lib/Gocdb_Services/Site.php
Comment thread tests/resourcesTests/ManageUnrenewedAPICredentialsTest.php
Comment thread tests/resourcesTests/ManageUnusedAPICredentialsTest.php
@Sae126V
Sae126V force-pushed the GT-184-Extend-API-Credential-Management-to-handle-periodic-renewal branch from e058dda to 00858bd Compare July 29, 2026 10:00
@Sae126V
Sae126V force-pushed the GT-184-Extend-API-Credential-Management-to-handle-periodic-renewal branch from 00858bd to 491abeb Compare July 29, 2026 10:35
@gregcorbett
gregcorbett merged commit f81476d into GOCDB:dev Aug 4, 2026
4 of 5 checks passed
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