Can you create a report of credential expiry?

Is it possible to create a report from Apigee for the credential expiry? (Developer Apps Expiration)

0 1 199
1 REPLY 1

Yes, it is possible, but you may have to put some effort into it. 

There is no management call that you can use to query "give me all the credentials that are expired" or "give me all the credentials that will expire within one week".  But, you could write a script that iterates through all the credentials and prints out a list of those that will expire within one week (or whatever your desired timespan is). This wouldn't be too difficult to do. 

In fact as I was answering this question, I thought I'd try it out.  So I wrote a tool implemented in nodejs to report on expired credentials, or credentials "about to expire", or delete expired credentials, or list apps with no credentials. Find it here

Some examples:

List apps with credentials that expired more than 1 day ago: 

 

$ node ./credentialsTool.js --apigeex --token $TOKEN -o $ORG --action list --timespan=1d
Apigee credentials tool, version: 20220819-0952
Node.js v16.15.0

[2022-Aug-19 10:44:19] found 5 apps for that org
[2022-Aug-19 10:44:19] found 1 app with credentials that expired before 2022-08-18T17:44:18.815Z
[2022-Aug-19 10:44:19] [
  {
    "name": "App1",
    "developerId": "19f45258-597a-4edf-bb88-b092cba9184a",
    "creds": [
      {
        "consumerKey": "jQ30FAfVw6GTfUR658F3CPKDbybe",
        "expiresAt": "1660773246689",
        "expires": "2022-08-17T21:54:06.689Z"
      }
    ]
  }
]

 

List apps with credentials that are not yet expired, but will expire within 30 days (note the negative timespan here): 

 

$ node ./credentialsTool.js --apigeex --token $TOKEN -o $ORG --action list --timespan=-30d
...

 

List apps with credentials that have no expiry: 

 

$ node ./credentialsTool.js --apigeex --token $TOKEN -o $ORG --action listNoExpiry
...

 

List apps with no credentials at all: 

 

$ node ./credentialsTool.js --apigeex --token $TOKEN -o $ORG --action listNoCreds
...

 

Delete credentials that expired more than 45 days ago: 

 

$ node ./credentialsTool.js --apigeex --token $TOKEN -o $ORG --action deleteExpired --timespan=45d
...