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

Request for Resource & Data Source for management of API Tokens #302

Open
davidfisher01 opened this issue Apr 18, 2024 · 5 comments
Open

Comments

@davidfisher01
Copy link

Hey guys,

It would be useful to be able to provision new API tokens through a terraform resource and retrieve them in code. Right now you can only create them manually through the integrations UI.

It would be nice if the tokens had a tag or name that can be referenced instead of just having a description.

Thanks!

@rocktavious
Copy link
Collaborator

Hey @davidfisher01 thanks for the suggestion. I do have a few questions for you.

1.) Would you expect to beable to provision the API token without first having an API token set in your terraform provider?
1a.) What user should the API token be associated with once its created?
2.) What is the actual concrete usecase you have for needing to provision new API tokens programmatically?
3.) What would you expect the datasource to return - the actual API token of an existing one created in your account?
4.) How do you intend to securely store these API tokens?

I look forward to your answers.

@davidfisher01
Copy link
Author

Our specific use case stems from managing a significant amount of these integrations with an API token per github organization roughly, so there are a ton of these tokens that we would rather automate and incorporate into our infrastructure. I would expect the user to be able to provision a new token without one existing already in its place via a new resource. The created by user can be attributed to either the admin team or just referencing "Terraform" and there can be certain values set on the resource that can define that as well. I would expect the datasource to return the token based off of a tag that the datasource is keying off from. All of the tokens we have are additionally placed in Vault for storage and access control purposes.

@rocktavious
Copy link
Collaborator

@davidfisher01
I would expect the user to be able to provision a new token without one existing already in its place via a new resource. our API doesn't know who you are unless you send along an API token with the request (because the API serves a multi-tenant SAAS application). So if getting a token from an un-authed context is your need then we simply cannot achieve this with our API architecture today (and honestly being able to arbitrarily provision API tokens without being auth'd is a massive security hole).

If you are ok with having to provision at least 1 API token manually and hand that to the terraform provider so that it can make additional API tokens then that is something we can get behind (though it gets complicated with RBAC scopes). Unfortunately i have no idea when our API team would beable to get to that though.

@davidfisher01
Copy link
Author

Sorry, that is exactly what I meant. "f you are ok with having to provision at least 1 API token manually and hand that to the terraform provider so that it can make additional API tokens".

@rocktavious
Copy link
Collaborator

Ok @davidfisher01 - Thanks for all the info i've taken this back to our API product manager as a feature request.

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

No branches or pull requests

2 participants