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

first draft add of datasource for user grants #201

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dfry
Copy link

@dfry dfry commented Oct 21, 2024

Adding this PR just to find out if this would be an acceptable addition to the provider.

Definition of Ready

  • Short description of the feature/issue is added in the pr description
  • PR is linked to the corresponding user story
  • Acceptance criteria are met
  • All open todos and follow ups are defined in a new ticket and justified
  • Deviations from the acceptance criteria and design are agreed with the PO and documented.
  • No debug or dead code
  • My code has no repetitions
  • All non-functional requirements are met
  • The generic lifecycle acceptance test passes for affected resources.
  • Examples are up-to-date and meaningful. The provider version is incremented.
  • Docs are generated.
  • Code is generated where possible.

@dfry
Copy link
Author

dfry commented Nov 21, 2024

@stebenz @hifabienne any feedback on this suggested feature? is this something you could see incorporating into your next release?

Copy link
Contributor

@stebenz stebenz left a comment

Choose a reason for hiding this comment

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

Some questions about the content of the PR.

zitadel/user_grant/funcs.go Outdated Show resolved Hide resolved
zitadel/user_grant/funcs.go Outdated Show resolved Hide resolved

ProjectNameQuery: &user.UserGrantProjectNameQuery{

ProjectName: projectName,
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 only the projectName used as a query? It is even listed as computed, I would rather use other identifiers first, and maybe provide the name later.

Copy link
Author

Choose a reason for hiding this comment

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

i am using projectName as the query because that is my current use case, i need to lookup the user grants by project name. Feel free to make it more generic or point me to an example of how you want it done.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good to me for the start, normally I would at least add the identifier of the project itself as a base query.
Have a look at the application_saml resouce as an example.

zitadel/user_grant/funcs.go Outdated Show resolved Hide resolved
@stebenz
Copy link
Contributor

stebenz commented Dec 16, 2024

Please also include the necessary templates and examples to regnerate the documentation, as a reference have a look in the paths templates/resources/application_saml.md.tmpl, templates/resources/application_samls.md.tmpl, examples/provider/data-sources/application_saml.tf and examples/provider/data-sources/application_samls.tf.

Testing for the datasource is also missing, please refer for that to the application_oidc/datasource_test.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

3 participants