mirror of
https://github.com/netbirdio/dex.git
synced 2026-05-22 18:43:53 -07:00
Merge pull request #2923 from dexidp/dependabot/go_modules/entgo.io/ent-0.12.3
build(deps): bump entgo.io/ent from 0.11.10 to 0.12.3
This commit is contained in:
@@ -3,7 +3,7 @@ module github.com/dexidp/dex
|
||||
go 1.20
|
||||
|
||||
require (
|
||||
entgo.io/ent v0.11.10
|
||||
entgo.io/ent v0.12.3
|
||||
github.com/AppsFlyer/go-sundheit v0.5.0
|
||||
github.com/Masterminds/semver v1.5.0
|
||||
github.com/Masterminds/sprig/v3 v3.2.3
|
||||
@@ -41,7 +41,7 @@ require (
|
||||
)
|
||||
|
||||
require (
|
||||
ariga.io/atlas v0.9.2-0.20230303073438-03a4779a6338 // indirect
|
||||
ariga.io/atlas v0.10.2-0.20230427182402-87a07dfb83bf // indirect
|
||||
cloud.google.com/go/compute v1.19.0 // indirect
|
||||
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
||||
github.com/Azure/go-ntlmssp v0.0.0-20220621081337-cb9428e4ac1e // indirect
|
||||
@@ -87,7 +87,7 @@ require (
|
||||
go.uber.org/atomic v1.7.0 // indirect
|
||||
go.uber.org/multierr v1.6.0 // indirect
|
||||
go.uber.org/zap v1.17.0 // indirect
|
||||
golang.org/x/mod v0.8.0 // indirect
|
||||
golang.org/x/mod v0.10.0 // indirect
|
||||
golang.org/x/sys v0.8.0 // indirect
|
||||
golang.org/x/text v0.9.0 // indirect
|
||||
google.golang.org/appengine v1.6.7 // indirect
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
ariga.io/atlas v0.9.2-0.20230303073438-03a4779a6338 h1:8kmSV3mbQKn0niZ/EdE11uhFvFKiW1VlaqVBIYOyahM=
|
||||
ariga.io/atlas v0.9.2-0.20230303073438-03a4779a6338/go.mod h1:T230JFcENj4ZZzMkZrXFDSkv+2kXkUgpJ5FQQ5hMcKU=
|
||||
ariga.io/atlas v0.10.2-0.20230427182402-87a07dfb83bf h1:Tq2DRB39ZHScIwWACjPKLv5oEErv7zv6PBb5RTz5CKA=
|
||||
ariga.io/atlas v0.10.2-0.20230427182402-87a07dfb83bf/go.mod h1:+TR129FJZ5Lvzms6dvCeGWh1yR6hMvmXBhug4hrNIGk=
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.110.0 h1:Zc8gqp3+a9/Eyph2KDmcGaPtbKRIoqq4YTlL4NMD0Ys=
|
||||
@@ -9,8 +9,8 @@ cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1h
|
||||
cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
|
||||
cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
|
||||
cloud.google.com/go/longrunning v0.4.1 h1:v+yFJOfKC3yZdY6ZUI933pIYdhyhV8S3NpWrXWmg7jM=
|
||||
entgo.io/ent v0.11.10 h1:iqn32ybY5HRW3xSAyMNdNKpZhKgMf1Zunsej9yPKUI8=
|
||||
entgo.io/ent v0.11.10/go.mod h1:mzTZ0trE+jCQw/fnzijbm5Mck/l8Gbg7gC/+L1COyzM=
|
||||
entgo.io/ent v0.12.3 h1:N5lO2EOrHpCH5HYfiMOCHYbo+oh5M8GjT0/cx5x6xkk=
|
||||
entgo.io/ent v0.12.3/go.mod h1:AigGGx+tbrBBYHAzGOg8ND661E5cxx1Uiu5o/otJ6Yg=
|
||||
github.com/AppsFlyer/go-sundheit v0.5.0 h1:/VxpyigCfJrq1r97mn9HPiAB2qrhcTFHwNIIDr15CZM=
|
||||
github.com/AppsFlyer/go-sundheit v0.5.0/go.mod h1:2ZM0BnfqT/mljBQO224VbL5XH06TgWuQ6Cn+cTtCpTY=
|
||||
github.com/Azure/go-ntlmssp v0.0.0-20220621081337-cb9428e4ac1e h1:NeAW1fUYUEWhft7pkxDf6WoUvEZJ/uOKsvtpjLnn8MU=
|
||||
@@ -263,8 +263,8 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
|
||||
golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"github.com/dexidp/dex/storage/ent/db/authcode"
|
||||
)
|
||||
@@ -47,6 +48,7 @@ type AuthCode struct {
|
||||
CodeChallenge string `json:"code_challenge,omitempty"`
|
||||
// CodeChallengeMethod holds the value of the "code_challenge_method" field.
|
||||
CodeChallengeMethod string `json:"code_challenge_method,omitempty"`
|
||||
selectValues sql.SelectValues
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
@@ -63,7 +65,7 @@ func (*AuthCode) scanValues(columns []string) ([]any, error) {
|
||||
case authcode.FieldExpiry:
|
||||
values[i] = new(sql.NullTime)
|
||||
default:
|
||||
return nil, fmt.Errorf("unexpected column %q for type AuthCode", columns[i])
|
||||
values[i] = new(sql.UnknownType)
|
||||
}
|
||||
}
|
||||
return values, nil
|
||||
@@ -177,11 +179,19 @@ func (ac *AuthCode) assignValues(columns []string, values []any) error {
|
||||
} else if value.Valid {
|
||||
ac.CodeChallengeMethod = value.String
|
||||
}
|
||||
default:
|
||||
ac.selectValues.Set(columns[i], values[i])
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Value returns the ent.Value that was dynamically selected and assigned to the AuthCode.
|
||||
// This includes values selected through modifiers, order, etc.
|
||||
func (ac *AuthCode) Value(name string) (ent.Value, error) {
|
||||
return ac.selectValues.Get(name)
|
||||
}
|
||||
|
||||
// Update returns a builder for updating this AuthCode.
|
||||
// Note that you need to call AuthCode.Unwrap() before calling this method if this AuthCode
|
||||
// was returned from a transaction, and the transaction was committed or rolled back.
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
package authcode
|
||||
|
||||
import (
|
||||
"entgo.io/ent/dialect/sql"
|
||||
)
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the authcode type in the database.
|
||||
Label = "auth_code"
|
||||
@@ -95,3 +99,71 @@ var (
|
||||
// IDValidator is a validator for the "id" field. It is called by the builders before save.
|
||||
IDValidator func(string) error
|
||||
)
|
||||
|
||||
// OrderOption defines the ordering options for the AuthCode queries.
|
||||
type OrderOption func(*sql.Selector)
|
||||
|
||||
// ByID orders the results by the id field.
|
||||
func ByID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByClientID orders the results by the client_id field.
|
||||
func ByClientID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldClientID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByNonce orders the results by the nonce field.
|
||||
func ByNonce(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldNonce, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByRedirectURI orders the results by the redirect_uri field.
|
||||
func ByRedirectURI(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldRedirectURI, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByClaimsUserID orders the results by the claims_user_id field.
|
||||
func ByClaimsUserID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldClaimsUserID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByClaimsUsername orders the results by the claims_username field.
|
||||
func ByClaimsUsername(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldClaimsUsername, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByClaimsEmail orders the results by the claims_email field.
|
||||
func ByClaimsEmail(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldClaimsEmail, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByClaimsEmailVerified orders the results by the claims_email_verified field.
|
||||
func ByClaimsEmailVerified(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldClaimsEmailVerified, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByClaimsPreferredUsername orders the results by the claims_preferred_username field.
|
||||
func ByClaimsPreferredUsername(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldClaimsPreferredUsername, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByConnectorID orders the results by the connector_id field.
|
||||
func ByConnectorID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldConnectorID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByExpiry orders the results by the expiry field.
|
||||
func ByExpiry(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldExpiry, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCodeChallenge orders the results by the code_challenge field.
|
||||
func ByCodeChallenge(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCodeChallenge, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCodeChallengeMethod orders the results by the code_challenge_method field.
|
||||
func ByCodeChallengeMethod(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCodeChallengeMethod, opts...).ToFunc()
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ func (acc *AuthCodeCreate) Mutation() *AuthCodeMutation {
|
||||
// Save creates the AuthCode in the database.
|
||||
func (acc *AuthCodeCreate) Save(ctx context.Context) (*AuthCode, error) {
|
||||
acc.defaults()
|
||||
return withHooks[*AuthCode, AuthCodeMutation](ctx, acc.sqlSave, acc.mutation, acc.hooks)
|
||||
return withHooks(ctx, acc.sqlSave, acc.mutation, acc.hooks)
|
||||
}
|
||||
|
||||
// SaveX calls Save and panics if Save returns an error.
|
||||
@@ -389,8 +389,8 @@ func (accb *AuthCodeCreateBulk) Save(ctx context.Context) ([]*AuthCode, error) {
|
||||
return nil, err
|
||||
}
|
||||
builder.mutation = mutation
|
||||
nodes[i], specs[i] = builder.createSpec()
|
||||
var err error
|
||||
nodes[i], specs[i] = builder.createSpec()
|
||||
if i < len(mutators)-1 {
|
||||
_, err = mutators[i+1].Mutate(root, accb.builders[i+1].mutation)
|
||||
} else {
|
||||
|
||||
@@ -27,7 +27,7 @@ func (acd *AuthCodeDelete) Where(ps ...predicate.AuthCode) *AuthCodeDelete {
|
||||
|
||||
// Exec executes the deletion query and returns how many vertices were deleted.
|
||||
func (acd *AuthCodeDelete) Exec(ctx context.Context) (int, error) {
|
||||
return withHooks[int, AuthCodeMutation](ctx, acd.sqlExec, acd.mutation, acd.hooks)
|
||||
return withHooks(ctx, acd.sqlExec, acd.mutation, acd.hooks)
|
||||
}
|
||||
|
||||
// ExecX is like Exec, but panics if an error occurs.
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
type AuthCodeQuery struct {
|
||||
config
|
||||
ctx *QueryContext
|
||||
order []OrderFunc
|
||||
order []authcode.OrderOption
|
||||
inters []Interceptor
|
||||
predicates []predicate.AuthCode
|
||||
// intermediate query (i.e. traversal path).
|
||||
@@ -52,7 +52,7 @@ func (acq *AuthCodeQuery) Unique(unique bool) *AuthCodeQuery {
|
||||
}
|
||||
|
||||
// Order specifies how the records should be ordered.
|
||||
func (acq *AuthCodeQuery) Order(o ...OrderFunc) *AuthCodeQuery {
|
||||
func (acq *AuthCodeQuery) Order(o ...authcode.OrderOption) *AuthCodeQuery {
|
||||
acq.order = append(acq.order, o...)
|
||||
return acq
|
||||
}
|
||||
@@ -246,7 +246,7 @@ func (acq *AuthCodeQuery) Clone() *AuthCodeQuery {
|
||||
return &AuthCodeQuery{
|
||||
config: acq.config,
|
||||
ctx: acq.ctx.Clone(),
|
||||
order: append([]OrderFunc{}, acq.order...),
|
||||
order: append([]authcode.OrderOption{}, acq.order...),
|
||||
inters: append([]Interceptor{}, acq.inters...),
|
||||
predicates: append([]predicate.AuthCode{}, acq.predicates...),
|
||||
// clone intermediate query.
|
||||
|
||||
@@ -180,7 +180,7 @@ func (acu *AuthCodeUpdate) Mutation() *AuthCodeMutation {
|
||||
|
||||
// Save executes the query and returns the number of nodes affected by the update operation.
|
||||
func (acu *AuthCodeUpdate) Save(ctx context.Context) (int, error) {
|
||||
return withHooks[int, AuthCodeMutation](ctx, acu.sqlSave, acu.mutation, acu.hooks)
|
||||
return withHooks(ctx, acu.sqlSave, acu.mutation, acu.hooks)
|
||||
}
|
||||
|
||||
// SaveX is like Save, but panics if an error occurs.
|
||||
@@ -505,7 +505,7 @@ func (acuo *AuthCodeUpdateOne) Select(field string, fields ...string) *AuthCodeU
|
||||
|
||||
// Save executes the query and returns the updated AuthCode entity.
|
||||
func (acuo *AuthCodeUpdateOne) Save(ctx context.Context) (*AuthCode, error) {
|
||||
return withHooks[*AuthCode, AuthCodeMutation](ctx, acuo.sqlSave, acuo.mutation, acuo.hooks)
|
||||
return withHooks(ctx, acuo.sqlSave, acuo.mutation, acuo.hooks)
|
||||
}
|
||||
|
||||
// SaveX is like Save, but panics if an error occurs.
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"github.com/dexidp/dex/storage/ent/db/authrequest"
|
||||
)
|
||||
@@ -56,7 +57,8 @@ type AuthRequest struct {
|
||||
// CodeChallengeMethod holds the value of the "code_challenge_method" field.
|
||||
CodeChallengeMethod string `json:"code_challenge_method,omitempty"`
|
||||
// HmacKey holds the value of the "hmac_key" field.
|
||||
HmacKey []byte `json:"hmac_key,omitempty"`
|
||||
HmacKey []byte `json:"hmac_key,omitempty"`
|
||||
selectValues sql.SelectValues
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
@@ -73,7 +75,7 @@ func (*AuthRequest) scanValues(columns []string) ([]any, error) {
|
||||
case authrequest.FieldExpiry:
|
||||
values[i] = new(sql.NullTime)
|
||||
default:
|
||||
return nil, fmt.Errorf("unexpected column %q for type AuthRequest", columns[i])
|
||||
values[i] = new(sql.UnknownType)
|
||||
}
|
||||
}
|
||||
return values, nil
|
||||
@@ -219,11 +221,19 @@ func (ar *AuthRequest) assignValues(columns []string, values []any) error {
|
||||
} else if value != nil {
|
||||
ar.HmacKey = *value
|
||||
}
|
||||
default:
|
||||
ar.selectValues.Set(columns[i], values[i])
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Value returns the ent.Value that was dynamically selected and assigned to the AuthRequest.
|
||||
// This includes values selected through modifiers, order, etc.
|
||||
func (ar *AuthRequest) Value(name string) (ent.Value, error) {
|
||||
return ar.selectValues.Get(name)
|
||||
}
|
||||
|
||||
// Update returns a builder for updating this AuthRequest.
|
||||
// Note that you need to call AuthRequest.Unwrap() before calling this method if this AuthRequest
|
||||
// was returned from a transaction, and the transaction was committed or rolled back.
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
package authrequest
|
||||
|
||||
import (
|
||||
"entgo.io/ent/dialect/sql"
|
||||
)
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the authrequest type in the database.
|
||||
Label = "auth_request"
|
||||
@@ -96,3 +100,86 @@ var (
|
||||
// IDValidator is a validator for the "id" field. It is called by the builders before save.
|
||||
IDValidator func(string) error
|
||||
)
|
||||
|
||||
// OrderOption defines the ordering options for the AuthRequest queries.
|
||||
type OrderOption func(*sql.Selector)
|
||||
|
||||
// ByID orders the results by the id field.
|
||||
func ByID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByClientID orders the results by the client_id field.
|
||||
func ByClientID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldClientID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByRedirectURI orders the results by the redirect_uri field.
|
||||
func ByRedirectURI(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldRedirectURI, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByNonce orders the results by the nonce field.
|
||||
func ByNonce(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldNonce, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByState orders the results by the state field.
|
||||
func ByState(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldState, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByForceApprovalPrompt orders the results by the force_approval_prompt field.
|
||||
func ByForceApprovalPrompt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldForceApprovalPrompt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByLoggedIn orders the results by the logged_in field.
|
||||
func ByLoggedIn(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldLoggedIn, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByClaimsUserID orders the results by the claims_user_id field.
|
||||
func ByClaimsUserID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldClaimsUserID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByClaimsUsername orders the results by the claims_username field.
|
||||
func ByClaimsUsername(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldClaimsUsername, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByClaimsEmail orders the results by the claims_email field.
|
||||
func ByClaimsEmail(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldClaimsEmail, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByClaimsEmailVerified orders the results by the claims_email_verified field.
|
||||
func ByClaimsEmailVerified(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldClaimsEmailVerified, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByClaimsPreferredUsername orders the results by the claims_preferred_username field.
|
||||
func ByClaimsPreferredUsername(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldClaimsPreferredUsername, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByConnectorID orders the results by the connector_id field.
|
||||
func ByConnectorID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldConnectorID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByExpiry orders the results by the expiry field.
|
||||
func ByExpiry(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldExpiry, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCodeChallenge orders the results by the code_challenge field.
|
||||
func ByCodeChallenge(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCodeChallenge, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCodeChallengeMethod orders the results by the code_challenge_method field.
|
||||
func ByCodeChallengeMethod(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCodeChallengeMethod, opts...).ToFunc()
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ func (arc *AuthRequestCreate) Mutation() *AuthRequestMutation {
|
||||
// Save creates the AuthRequest in the database.
|
||||
func (arc *AuthRequestCreate) Save(ctx context.Context) (*AuthRequest, error) {
|
||||
arc.defaults()
|
||||
return withHooks[*AuthRequest, AuthRequestMutation](ctx, arc.sqlSave, arc.mutation, arc.hooks)
|
||||
return withHooks(ctx, arc.sqlSave, arc.mutation, arc.hooks)
|
||||
}
|
||||
|
||||
// SaveX calls Save and panics if Save returns an error.
|
||||
@@ -416,8 +416,8 @@ func (arcb *AuthRequestCreateBulk) Save(ctx context.Context) ([]*AuthRequest, er
|
||||
return nil, err
|
||||
}
|
||||
builder.mutation = mutation
|
||||
nodes[i], specs[i] = builder.createSpec()
|
||||
var err error
|
||||
nodes[i], specs[i] = builder.createSpec()
|
||||
if i < len(mutators)-1 {
|
||||
_, err = mutators[i+1].Mutate(root, arcb.builders[i+1].mutation)
|
||||
} else {
|
||||
|
||||
@@ -27,7 +27,7 @@ func (ard *AuthRequestDelete) Where(ps ...predicate.AuthRequest) *AuthRequestDel
|
||||
|
||||
// Exec executes the deletion query and returns how many vertices were deleted.
|
||||
func (ard *AuthRequestDelete) Exec(ctx context.Context) (int, error) {
|
||||
return withHooks[int, AuthRequestMutation](ctx, ard.sqlExec, ard.mutation, ard.hooks)
|
||||
return withHooks(ctx, ard.sqlExec, ard.mutation, ard.hooks)
|
||||
}
|
||||
|
||||
// ExecX is like Exec, but panics if an error occurs.
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
type AuthRequestQuery struct {
|
||||
config
|
||||
ctx *QueryContext
|
||||
order []OrderFunc
|
||||
order []authrequest.OrderOption
|
||||
inters []Interceptor
|
||||
predicates []predicate.AuthRequest
|
||||
// intermediate query (i.e. traversal path).
|
||||
@@ -52,7 +52,7 @@ func (arq *AuthRequestQuery) Unique(unique bool) *AuthRequestQuery {
|
||||
}
|
||||
|
||||
// Order specifies how the records should be ordered.
|
||||
func (arq *AuthRequestQuery) Order(o ...OrderFunc) *AuthRequestQuery {
|
||||
func (arq *AuthRequestQuery) Order(o ...authrequest.OrderOption) *AuthRequestQuery {
|
||||
arq.order = append(arq.order, o...)
|
||||
return arq
|
||||
}
|
||||
@@ -246,7 +246,7 @@ func (arq *AuthRequestQuery) Clone() *AuthRequestQuery {
|
||||
return &AuthRequestQuery{
|
||||
config: arq.config,
|
||||
ctx: arq.ctx.Clone(),
|
||||
order: append([]OrderFunc{}, arq.order...),
|
||||
order: append([]authrequest.OrderOption{}, arq.order...),
|
||||
inters: append([]Interceptor{}, arq.inters...),
|
||||
predicates: append([]predicate.AuthRequest{}, arq.predicates...),
|
||||
// clone intermediate query.
|
||||
|
||||
@@ -222,7 +222,7 @@ func (aru *AuthRequestUpdate) Mutation() *AuthRequestMutation {
|
||||
|
||||
// Save executes the query and returns the number of nodes affected by the update operation.
|
||||
func (aru *AuthRequestUpdate) Save(ctx context.Context) (int, error) {
|
||||
return withHooks[int, AuthRequestMutation](ctx, aru.sqlSave, aru.mutation, aru.hooks)
|
||||
return withHooks(ctx, aru.sqlSave, aru.mutation, aru.hooks)
|
||||
}
|
||||
|
||||
// SaveX is like Save, but panics if an error occurs.
|
||||
@@ -569,7 +569,7 @@ func (aruo *AuthRequestUpdateOne) Select(field string, fields ...string) *AuthRe
|
||||
|
||||
// Save executes the query and returns the updated AuthRequest entity.
|
||||
func (aruo *AuthRequestUpdateOne) Save(ctx context.Context) (*AuthRequest, error) {
|
||||
return withHooks[*AuthRequest, AuthRequestMutation](ctx, aruo.sqlSave, aruo.mutation, aruo.hooks)
|
||||
return withHooks(ctx, aruo.sqlSave, aruo.mutation, aruo.hooks)
|
||||
}
|
||||
|
||||
// SaveX is like Save, but panics if an error occurs.
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"github.com/dexidp/dex/storage/ent/db/connector"
|
||||
)
|
||||
@@ -22,7 +23,8 @@ type Connector struct {
|
||||
// ResourceVersion holds the value of the "resource_version" field.
|
||||
ResourceVersion string `json:"resource_version,omitempty"`
|
||||
// Config holds the value of the "config" field.
|
||||
Config []byte `json:"config,omitempty"`
|
||||
Config []byte `json:"config,omitempty"`
|
||||
selectValues sql.SelectValues
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
@@ -35,7 +37,7 @@ func (*Connector) scanValues(columns []string) ([]any, error) {
|
||||
case connector.FieldID, connector.FieldType, connector.FieldName, connector.FieldResourceVersion:
|
||||
values[i] = new(sql.NullString)
|
||||
default:
|
||||
return nil, fmt.Errorf("unexpected column %q for type Connector", columns[i])
|
||||
values[i] = new(sql.UnknownType)
|
||||
}
|
||||
}
|
||||
return values, nil
|
||||
@@ -79,11 +81,19 @@ func (c *Connector) assignValues(columns []string, values []any) error {
|
||||
} else if value != nil {
|
||||
c.Config = *value
|
||||
}
|
||||
default:
|
||||
c.selectValues.Set(columns[i], values[i])
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Value returns the ent.Value that was dynamically selected and assigned to the Connector.
|
||||
// This includes values selected through modifiers, order, etc.
|
||||
func (c *Connector) Value(name string) (ent.Value, error) {
|
||||
return c.selectValues.Get(name)
|
||||
}
|
||||
|
||||
// Update returns a builder for updating this Connector.
|
||||
// Note that you need to call Connector.Unwrap() before calling this method if this Connector
|
||||
// was returned from a transaction, and the transaction was committed or rolled back.
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
package connector
|
||||
|
||||
import (
|
||||
"entgo.io/ent/dialect/sql"
|
||||
)
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the connector type in the database.
|
||||
Label = "connector"
|
||||
@@ -46,3 +50,26 @@ var (
|
||||
// IDValidator is a validator for the "id" field. It is called by the builders before save.
|
||||
IDValidator func(string) error
|
||||
)
|
||||
|
||||
// OrderOption defines the ordering options for the Connector queries.
|
||||
type OrderOption func(*sql.Selector)
|
||||
|
||||
// ByID orders the results by the id field.
|
||||
func ByID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByType orders the results by the type field.
|
||||
func ByType(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldType, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByName orders the results by the name field.
|
||||
func ByName(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldName, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByResourceVersion orders the results by the resource_version field.
|
||||
func ByResourceVersion(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldResourceVersion, opts...).ToFunc()
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ func (cc *ConnectorCreate) Mutation() *ConnectorMutation {
|
||||
|
||||
// Save creates the Connector in the database.
|
||||
func (cc *ConnectorCreate) Save(ctx context.Context) (*Connector, error) {
|
||||
return withHooks[*Connector, ConnectorMutation](ctx, cc.sqlSave, cc.mutation, cc.hooks)
|
||||
return withHooks(ctx, cc.sqlSave, cc.mutation, cc.hooks)
|
||||
}
|
||||
|
||||
// SaveX calls Save and panics if Save returns an error.
|
||||
@@ -187,8 +187,8 @@ func (ccb *ConnectorCreateBulk) Save(ctx context.Context) ([]*Connector, error)
|
||||
return nil, err
|
||||
}
|
||||
builder.mutation = mutation
|
||||
nodes[i], specs[i] = builder.createSpec()
|
||||
var err error
|
||||
nodes[i], specs[i] = builder.createSpec()
|
||||
if i < len(mutators)-1 {
|
||||
_, err = mutators[i+1].Mutate(root, ccb.builders[i+1].mutation)
|
||||
} else {
|
||||
|
||||
@@ -27,7 +27,7 @@ func (cd *ConnectorDelete) Where(ps ...predicate.Connector) *ConnectorDelete {
|
||||
|
||||
// Exec executes the deletion query and returns how many vertices were deleted.
|
||||
func (cd *ConnectorDelete) Exec(ctx context.Context) (int, error) {
|
||||
return withHooks[int, ConnectorMutation](ctx, cd.sqlExec, cd.mutation, cd.hooks)
|
||||
return withHooks(ctx, cd.sqlExec, cd.mutation, cd.hooks)
|
||||
}
|
||||
|
||||
// ExecX is like Exec, but panics if an error occurs.
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
type ConnectorQuery struct {
|
||||
config
|
||||
ctx *QueryContext
|
||||
order []OrderFunc
|
||||
order []connector.OrderOption
|
||||
inters []Interceptor
|
||||
predicates []predicate.Connector
|
||||
// intermediate query (i.e. traversal path).
|
||||
@@ -52,7 +52,7 @@ func (cq *ConnectorQuery) Unique(unique bool) *ConnectorQuery {
|
||||
}
|
||||
|
||||
// Order specifies how the records should be ordered.
|
||||
func (cq *ConnectorQuery) Order(o ...OrderFunc) *ConnectorQuery {
|
||||
func (cq *ConnectorQuery) Order(o ...connector.OrderOption) *ConnectorQuery {
|
||||
cq.order = append(cq.order, o...)
|
||||
return cq
|
||||
}
|
||||
@@ -246,7 +246,7 @@ func (cq *ConnectorQuery) Clone() *ConnectorQuery {
|
||||
return &ConnectorQuery{
|
||||
config: cq.config,
|
||||
ctx: cq.ctx.Clone(),
|
||||
order: append([]OrderFunc{}, cq.order...),
|
||||
order: append([]connector.OrderOption{}, cq.order...),
|
||||
inters: append([]Interceptor{}, cq.inters...),
|
||||
predicates: append([]predicate.Connector{}, cq.predicates...),
|
||||
// clone intermediate query.
|
||||
|
||||
@@ -58,7 +58,7 @@ func (cu *ConnectorUpdate) Mutation() *ConnectorMutation {
|
||||
|
||||
// Save executes the query and returns the number of nodes affected by the update operation.
|
||||
func (cu *ConnectorUpdate) Save(ctx context.Context) (int, error) {
|
||||
return withHooks[int, ConnectorMutation](ctx, cu.sqlSave, cu.mutation, cu.hooks)
|
||||
return withHooks(ctx, cu.sqlSave, cu.mutation, cu.hooks)
|
||||
}
|
||||
|
||||
// SaveX is like Save, but panics if an error occurs.
|
||||
@@ -186,7 +186,7 @@ func (cuo *ConnectorUpdateOne) Select(field string, fields ...string) *Connector
|
||||
|
||||
// Save executes the query and returns the updated Connector entity.
|
||||
func (cuo *ConnectorUpdateOne) Save(ctx context.Context) (*Connector, error) {
|
||||
return withHooks[*Connector, ConnectorMutation](ctx, cuo.sqlSave, cuo.mutation, cuo.hooks)
|
||||
return withHooks(ctx, cuo.sqlSave, cuo.mutation, cuo.hooks)
|
||||
}
|
||||
|
||||
// SaveX is like Save, but panics if an error occurs.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user