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

bug: fixes missing expiry during update #341 #343

Merged
merged 5 commits into from
Dec 14, 2023
Merged

bug: fixes missing expiry during update #341 #343

merged 5 commits into from
Dec 14, 2023

Conversation

srinandan
Copy link
Collaborator

No description provided.

@srinandan srinandan added the bug Something isn't working label Dec 2, 2023
@srinandan srinandan linked an issue Dec 2, 2023 that may be closed by this pull request
@srinandan
Copy link
Collaborator Author

This doesn't fix the issue. But I think it is necessary.

Copy link
Collaborator

@kurtkanaskie kurtkanaskie left a comment

Choose a reason for hiding this comment

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

App keys APIs are kinda confusing and messy.
I can generate new keys, assign to product and set expiration using a single API call: https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.developers.apps/generateKeyPairOrUpdateDeveloperAppStatus

Or I can import external keys (but not expiration) using: https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.developers.apps.keys/create
And then add product using: https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.developers.apps.keys/updateDeveloperAppKey

So how do I generate app keys via apigeecli?
This requires key and secret
apps keys create --org=$ORG --dev=demo@any.com --name=demo-app --expires=2678389502 --prods=demo

@srinandan
Copy link
Collaborator Author

To generate a new key pair:

apigeecli apps genkey --help
Generate a new developer KeyPair

Usage:
  apigeecli apps genkey [flags]

Flags:
  -c, --callback string      The callbackUrl is used by OAuth
  -d, --devid string         Developer Id
  -x, --expires string       A setting, in milliseconds, for the lifetime of the consumer key
  -h, --help                 help for genkey
  -n, --name string          Name of the developer app
  -p, --prods stringArray    A list of api products
  -s, --scopes stringArray   OAuth scopes

@kurtkanaskie
Copy link
Collaborator

The expires flag is now in seconds consistently and only used for apps keys create and apps genkey.
Removed required secret from apps keys udpate, its not needed.

cmd/apps/updatekey.go Outdated Show resolved Hide resolved
@srinandan srinandan merged commit 4ab7176 into main Dec 14, 2023
5 checks passed
@srinandan srinandan deleted the issue341 branch December 14, 2023 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

apps keys create and update not setting expiration on key
2 participants