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

Add Api Tokens Data Source #104

Merged
merged 34 commits into from
Jul 9, 2024
Merged

Add Api Tokens Data Source #104

merged 34 commits into from
Jul 9, 2024

Conversation

ichung08
Copy link
Collaborator

@ichung08 ichung08 commented Jul 8, 2024

Description

  • Add api token and api tokens data source

🎟 Issue(s)

#103

🧪 Functional Testing

  • Get API Token:
Screenshot 2024-07-08 at 1 04 27 PM
  • List API Tokens:
Screenshot 2024-07-08 at 1 20 52 PM

📸 Screenshots

📋 Checklist

  • Added/updated applicable tests
  • Added/updated examples in the examples/ directory
  • Updated any related documentation

@ichung08 ichung08 self-assigned this Jul 8, 2024
@ichung08 ichung08 linked an issue Jul 8, 2024 that may be closed by this pull request
ExpiryPeriodInDays types.Int64 `tfsdk:"expiry_period_in_days"`
LastUsedAt types.String `tfsdk:"last_used_at"`
Roles types.Set `tfsdk:"roles"`
Token types.String `tfsdk:"token"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

will prob need to split up this into ApiTokenResource and ApiTokenDataSource similar to Deployment since Token will only show up in resource

  • will need to figure out how to do rotate and updating roles

ichung08 and others added 15 commits July 9, 2024 06:54
Co-authored-by: Vandy Liu <33995460+vandyliu@users.noreply.github.com>
Co-authored-by: Vandy Liu <33995460+vandyliu@users.noreply.github.com>
Co-authored-by: Vandy Liu <33995460+vandyliu@users.noreply.github.com>
Co-authored-by: Vandy Liu <33995460+vandyliu@users.noreply.github.com>
@ichung08 ichung08 marked this pull request as ready for review July 9, 2024 16:35
tfOrganizationId := os.Getenv("HOSTED_ORGANIZATION_ID")
tfWorkspaceId := os.Getenv("HOSTED_WORKSPACE_ID")
tfDeploymentId := os.Getenv("HOSTED_DEPLOYMENT_ID")
tfOrgOnly := true
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: not needed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

why is this not needed? i used all of these ids as a check in checkApiTokens function

internal/utils/test.go Outdated Show resolved Hide resolved
ichung08 and others added 10 commits July 9, 2024 11:24
Co-authored-by: Vandy Liu <33995460+vandyliu@users.noreply.github.com>
Co-authored-by: Vandy Liu <33995460+vandyliu@users.noreply.github.com>
Co-authored-by: Vandy Liu <33995460+vandyliu@users.noreply.github.com>
Co-authored-by: Vandy Liu <33995460+vandyliu@users.noreply.github.com>
Co-authored-by: Vandy Liu <33995460+vandyliu@users.noreply.github.com>
Co-authored-by: Vandy Liu <33995460+vandyliu@users.noreply.github.com>
Co-authored-by: Vandy Liu <33995460+vandyliu@users.noreply.github.com>
…r/astronomer-terraform-provider into 103-add-api-tokens-data-source
internal/utils/test.go Outdated Show resolved Hide resolved
internal/utils/test.go Outdated Show resolved Hide resolved
internal/utils/test.go Outdated Show resolved Hide resolved
internal/utils/test.go Outdated Show resolved Hide resolved
@ichung08 ichung08 merged commit 56e00be into main Jul 9, 2024
7 checks passed
@ichung08 ichung08 deleted the 103-add-api-tokens-data-source branch July 9, 2024 19:39
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.

Add api tokens data source
2 participants