Skip to content

Commit

Permalink
entgql: always skip sensitive fields (#384)
Browse files Browse the repository at this point in the history
  • Loading branch information
giautm authored Oct 2, 2022
1 parent f84d0b0 commit 6ef74f1
Show file tree
Hide file tree
Showing 39 changed files with 1,278 additions and 15 deletions.
3 changes: 3 additions & 0 deletions entgql/internal/todo/ent.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ Input was generated by ent.
"""
input CreateUserInput {
name: String
password: String
groupIDs: [ID!]
friendIDs: [ID!]
}
Expand Down Expand Up @@ -504,6 +505,8 @@ Input was generated by ent.
"""
input UpdateUserInput {
name: String
clearPassword: Boolean
password: String
addGroupIDs: [ID!]
removeGroupIDs: [ID!]
addFriendIDs: [ID!]
Expand Down
12 changes: 12 additions & 0 deletions entgql/internal/todo/ent/gql_mutation_input.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion entgql/internal/todo/ent/gql_node.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 62 additions & 0 deletions entgql/internal/todo/ent/gql_where_input.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions entgql/internal/todo/ent/migrate/schema.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 78 additions & 2 deletions entgql/internal/todo/ent/mutation.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions entgql/internal/todo/ent/schema/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ func (User) Fields() []ent.Field {
return []ent.Field{
field.String("name").
Default("Anonymous"),
field.String("password").
Sensitive().
Optional(),
}
}

Expand Down
12 changes: 11 additions & 1 deletion entgql/internal/todo/ent/user.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions entgql/internal/todo/ent/user/user.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6ef74f1

Please sign in to comment.