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

New Data Source: wiz_users #49

Merged
merged 2 commits into from
Dec 14, 2022
Merged

New Data Source: wiz_users #49

merged 2 commits into from
Dec 14, 2022

Conversation

jschoombee
Copy link
Collaborator

New Data Source: wiz_users (closes #48)

Adding a new data source for wiz_users to retrieve local and idp-backed user details

Comment on lines 2133 to 2172
// Users struct
type Users struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is representative of UserConnection from the GraphQL schema.

The users Query from the GraphQL schema returns a UserConnection:

type Query {
  users(after: String, filterBy: UserFilters, first: Int): UserConnection!
}

This should be renamed to match the GraphQL type to aid in future development and avoid namespace conflicts.

type UserConnection {
  edges: [UserEdge!]
  exportUrl(format: ExportFormats = CSV, limit: Int = 5000): String
  nodes: [User!]
  pageInfo: PageInfo!
  totalCount: Int!
}
Suggested change
// Users struct
type Users struct {
// UserConnection struct
type UserConnection struct {

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, will update


// ReadUsers struct
type ReadUsers struct {
Users vendor.Users `json:"users"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Refactor type from Users to UserConnection.

Suggested change
Users vendor.Users `json:"users"`
Users vendor.UserConnection `json:"users"`

@gramsa49 gramsa49 merged commit f3ee027 into AxtonGrams:main Dec 14, 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.

wiz_users datasource
2 participants