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

Resource: service #219

Merged
merged 68 commits into from Dec 8, 2022
Merged

Conversation

vmanilo
Copy link
Contributor

@vmanilo vmanilo commented Nov 16, 2022

Resolves #67

Changes

  • added service-account resource

@vmanilo vmanilo changed the title Service-account resource Resource: service Nov 24, 2022
@vmanilo vmanilo changed the title Resource: service #1 - Resource: service Nov 25, 2022
@vmanilo vmanilo marked this pull request as ready for review November 26, 2022 21:46
@vmanilo vmanilo requested a review from a team as a code owner November 26, 2022 21:46
@vmanilo vmanilo changed the title #1 - Resource: service Resource: service Nov 27, 2022
Copy link
Contributor

@alexmensch alexmensch left a comment

Choose a reason for hiding this comment

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

Some simple changes (I'll make the same changes in the public documentation)

page_title: "twingate_service_account Resource - terraform-provider-twingate"
subcategory: ""
description: |-
Services offer a way to provide programmatic, centrally-controlled, and consistent access controls. For more information, see Twingate's documentation https://www.twingate.com/docs/services.
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this is taken from the public docs, but let's do this everywhere: s/Services/Service Accounts/g

In this description, let's remove the sentence "For more information [...]"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alexmensch I've updated doc strings

docs/resources/service_account.md Outdated Show resolved Hide resolved
docs/resources/service_account.md Outdated Show resolved Hide resolved
docs/resources/service_account.md Outdated Show resolved Hide resolved
@@ -0,0 +1,84 @@
package client
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this here and not in twingate/internal/test/client ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

here I'm testing private func fetchPages and it's not accessible from other packages

@@ -230,3 +230,31 @@ func (r ResourceNode) ToModel() *model.Resource {
func (q readResourcesByNameQuery) ToModel() []*model.Resource {
return q.Resources.ToModel()
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Its something I missed in the restructure review but Im not sure I understand the purpose of converter.go - we define createServiceAccountQuery in service-account.go why cant its methods be there?
(same for all the other structs that their methods are here)

Copy link
Contributor

Choose a reason for hiding this comment

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

or maybe the struct defintion should be here too?
or maybe we need queries/createServiceAccountQuery.go ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

here in converter.go I've collected simple utilities functions which converts queries objects to models

I think in service-account.go would be better to have only code related to API request, and this object conversions like lower layer details

I like the idea with separate package for queries, I think this can help organise code better :)

Copy link
Contributor

Choose a reason for hiding this comment

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

ok so lets merge this and refactor to queries on a separate PR

@ekampf ekampf merged commit a9d4ab9 into Twingate:main Dec 8, 2022
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 the ability to create and configure service accounts
3 participants