GOCDB / gocdb

Grid Operations Configuration Management Database. A Repository, Portal and REST style API for managing Grid and Cloud topology objects including; projects, administrative domains, sites, services, service-endpoints, service-groups, downtimes, users, roles and business rules.
Apache License 2.0
12 stars 28 forks source link

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

Open Sae126V opened 1 year ago

Sae126V commented 1 year ago

Resolves

" #438 and #453 "

Sae126V commented 1 year ago

@gregcorbett , This is ready for the functionality review.

gregcorbett commented 1 year ago

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

Sae126V commented 1 year ago

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

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

Sae126V commented 1 year ago

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?

Right. I see the flow of code was designed such that it calculates the month difference i.e. say, Sept to sept the month difference is zero and it ignored the year part. I have provided a fix in 0d1ec9abee0d0f4ee6f42ce0b0a439fd8f86e603.

Sae126V commented 1 year ago

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