Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

DXCDT-21: Global client data source #512

Merged
merged 4 commits into from
Feb 14, 2022

Conversation

willvedd
Copy link
Collaborator

@willvedd willvedd commented Feb 4, 2022

Proposed Changes

Adding global client data source. Similarly to #511 , this PR heavily references @yinzara 's #363.

Still in draft as I better understand the use case and expected attributes; I've pointed out some inconsistencies below.

Acceptance Test Output

$ make testacc TESTS=TestAccXXX

=== RUN   TestAccDataGlobalClient
--- PASS: TestAccDataGlobalClient (3.95s)
PASS

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

## Attribute Reference

* `client_id` - String. ID of the client.
* `client_secret`<sup>[1](#client-keys)</sup> - String. Secret for the client; keep this private.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@sergiughf At this point in time, I can't think a reasonable use case for exposing the client secret, but it's in line with the other client data source. What do you think about including?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Considering we're using this as a data source to be ingested elsewhere I would tend to prefer removing it so we don't store it inside the state, just because it's a secret. If a valid use case for us having it there presents itself we could always re-add it. Would this work?

Copy link
Contributor

Choose a reason for hiding this comment

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

Just thought I'd mention, I use my custom branch that has this data source to keep different tenants custom login pages synced. Specifically I have a master tenant that has my preferred custom login page and I use this data source to copy between tenants.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@yinzara Really appreciate the input. After some investigation, that appears to be the primary use case for the global client DS. Am I correct in believing that you do not require the fetching of the client secret?

@willvedd willvedd marked this pull request as ready for review February 8, 2022 21:19
func newClientSchema() map[string]*schema.Schema {
clientSchema := datasourceSchemaFromResourceSchema(newClient().Schema)
delete(clientSchema, "client_secret_rotation_trigger")
delete(clientSchema, "client_secret")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@sergiughf With our decision to remove client_secret from the global client schema, it also makes sense to remove for all clients. I don't believe we've released that DS yet so this should be fine. Can always add in if someone has a compelling use case for it.

@willvedd willvedd merged commit c762d42 into master Feb 14, 2022
@willvedd willvedd deleted the DXCDT-21-global-client-data-source branch February 14, 2022 17:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants