diff --git a/cmd/config/example.go b/cmd/config/example.go index 63423f477..e85e12e3a 100644 --- a/cmd/config/example.go +++ b/cmd/config/example.go @@ -267,6 +267,12 @@ func commandExample(cCtx *cli.Context) error { //nolint:funlen,maintidx ClientSecret: ptr("clientsecret"), Audience: ptr("audience"), }, + Entraid: &model.ConfigAuthMethodOauthEntraid{ + ClientId: ptr("entraidClientId"), + ClientSecret: ptr("entraidClientSecret"), + Enabled: ptr(true), + Tenant: ptr("entraidTenant"), + }, Facebook: &model.ConfigStandardOauthProviderWithScope{ Enabled: ptr(true), ClientId: ptr("clientid"), diff --git a/cmd/config/validate_test.go b/cmd/config/validate_test.go index b05b704a5..c9890f728 100644 --- a/cmd/config/validate_test.go +++ b/cmd/config/validate_test.go @@ -137,6 +137,10 @@ func expectedConfig() *model.ConfigConfig { Discord: &model.ConfigStandardOauthProviderWithScope{ Enabled: ptr(false), }, + Entraid: &model.ConfigAuthMethodOauthEntraid{ + Enabled: ptr(false), + Tenant: ptr("common"), + }, Facebook: &model.ConfigStandardOauthProviderWithScope{ Enabled: ptr(false), }, diff --git a/dockercompose/auth_test.go b/dockercompose/auth_test.go index 084200e14..3c12815cc 100644 --- a/dockercompose/auth_test.go +++ b/dockercompose/auth_test.go @@ -65,6 +65,10 @@ func expectedAuth() *Service { "AUTH_PROVIDER_DISCORD_CLIENT_SECRET": "discordClientSecret", "AUTH_PROVIDER_DISCORD_ENABLED": "true", "AUTH_PROVIDER_DISCORD_SCOPE": "identify,email", + "AUTH_PROVIDER_ENTRAID_CLIENT_ID": "entraidClientId", + "AUTH_PROVIDER_ENTRAID_CLIENT_SECRET": "entraidClientSecret", + "AUTH_PROVIDER_ENTRAID_ENABLED": "true", + "AUTH_PROVIDER_ENTRAID_TENANT": "entraidTenant", "AUTH_PROVIDER_FACEBOOK_AUDIENCE": "audience", "AUTH_PROVIDER_FACEBOOK_CLIENT_ID": "facebookClientId", "AUTH_PROVIDER_FACEBOOK_CLIENT_SECRET": "facebookClientSecret", diff --git a/dockercompose/main_test.go b/dockercompose/main_test.go index e0621d7c9..c06ce5edc 100644 --- a/dockercompose/main_test.go +++ b/dockercompose/main_test.go @@ -107,6 +107,12 @@ func getConfig() *model.ConfigConfig { //nolint:maintidx Scope: []string{"identify", "email"}, Audience: ptr("audience"), }, + Entraid: &model.ConfigAuthMethodOauthEntraid{ + ClientId: ptr("entraidClientId"), + ClientSecret: ptr("entraidClientSecret"), + Enabled: ptr(true), + Tenant: ptr("entraidTenant"), + }, Facebook: &model.ConfigStandardOauthProviderWithScope{ ClientId: ptr("facebookClientId"), ClientSecret: ptr("facebookClientSecret"), diff --git a/go.mod b/go.mod index 72f2bda67..890634707 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/google/go-cmp v0.7.0 github.com/google/uuid v1.6.0 github.com/hashicorp/go-getter v1.7.8 - github.com/nhost/be v0.0.0-20250730065440-072ba750534a + github.com/nhost/be v0.0.0-20250826100053-51f349e46355 github.com/pelletier/go-toml/v2 v2.2.4 github.com/rs/cors/wrapper/gin v0.0.0-20240830163046-1084d89a1692 github.com/sirupsen/logrus v1.9.3 diff --git a/go.sum b/go.sum index 6995378ae..52e89af02 100644 --- a/go.sum +++ b/go.sum @@ -1049,6 +1049,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/nhost/be v0.0.0-20250730065440-072ba750534a h1:PBNFdtz2XdGUbFVDTJNBdKwtWLab3jgEl0fpb5rn3j0= github.com/nhost/be v0.0.0-20250730065440-072ba750534a/go.mod h1:Btk2JXy1ih/+VTlNItNNFfhOTZlKlrodBqXaJ+2K7Pg= +github.com/nhost/be v0.0.0-20250826100053-51f349e46355 h1:K0orUm3ex3GBuZ8InnmSjAVbYqcO4LfK1ftcsPDS6k0= +github.com/nhost/be v0.0.0-20250826100053-51f349e46355/go.mod h1:iRPhO+qcQzTtNQ7PaQMJAcEw0tgWzgjzcGWgJ4ifrUo= github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= diff --git a/nhostclient/graphql/models_gen.go b/nhostclient/graphql/models_gen.go index 37a15192f..41c062249 100644 --- a/nhostclient/graphql/models_gen.go +++ b/nhostclient/graphql/models_gen.go @@ -135,6 +135,7 @@ type ConfigAuthMethodOauth struct { Azuread *ConfigAuthMethodOauthAzuread `json:"azuread,omitempty"` Bitbucket *ConfigStandardOauthProvider `json:"bitbucket,omitempty"` Discord *ConfigStandardOauthProviderWithScope `json:"discord,omitempty"` + Entraid *ConfigAuthMethodOauthEntraid `json:"entraid,omitempty"` Facebook *ConfigStandardOauthProviderWithScope `json:"facebook,omitempty"` Github *ConfigStandardOauthProviderWithScope `json:"github,omitempty"` Gitlab *ConfigStandardOauthProviderWithScope `json:"gitlab,omitempty"` @@ -182,6 +183,20 @@ type ConfigAuthMethodOauthAzureadUpdateInput struct { Tenant *string `json:"tenant,omitempty"` } +type ConfigAuthMethodOauthEntraid struct { + ClientID *string `json:"clientId,omitempty"` + ClientSecret *string `json:"clientSecret,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Tenant *string `json:"tenant,omitempty"` +} + +type ConfigAuthMethodOauthEntraidUpdateInput struct { + ClientID *string `json:"clientId,omitempty"` + ClientSecret *string `json:"clientSecret,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Tenant *string `json:"tenant,omitempty"` +} + type ConfigAuthMethodOauthTwitter struct { ConsumerKey *string `json:"consumerKey,omitempty"` ConsumerSecret *string `json:"consumerSecret,omitempty"` @@ -199,6 +214,7 @@ type ConfigAuthMethodOauthUpdateInput struct { Azuread *ConfigAuthMethodOauthAzureadUpdateInput `json:"azuread,omitempty"` Bitbucket *ConfigStandardOauthProviderUpdateInput `json:"bitbucket,omitempty"` Discord *ConfigStandardOauthProviderWithScopeUpdateInput `json:"discord,omitempty"` + Entraid *ConfigAuthMethodOauthEntraidUpdateInput `json:"entraid,omitempty"` Facebook *ConfigStandardOauthProviderWithScopeUpdateInput `json:"facebook,omitempty"` Github *ConfigStandardOauthProviderWithScopeUpdateInput `json:"github,omitempty"` Gitlab *ConfigStandardOauthProviderWithScopeUpdateInput `json:"gitlab,omitempty"` diff --git a/vendor/github.com/nhost/be/services/mimir/graph/generated/generated.go b/vendor/github.com/nhost/be/services/mimir/graph/generated/generated.go index 94bc94ffe..ac05f0307 100644 --- a/vendor/github.com/nhost/be/services/mimir/graph/generated/generated.go +++ b/vendor/github.com/nhost/be/services/mimir/graph/generated/generated.go @@ -132,6 +132,7 @@ type ComplexityRoot struct { Azuread func(childComplexity int) int Bitbucket func(childComplexity int) int Discord func(childComplexity int) int + Entraid func(childComplexity int) int Facebook func(childComplexity int) int Github func(childComplexity int) int Gitlab func(childComplexity int) int @@ -162,6 +163,13 @@ type ComplexityRoot struct { Tenant func(childComplexity int) int } + ConfigAuthMethodOauthEntraid struct { + ClientId func(childComplexity int) int + ClientSecret func(childComplexity int) int + Enabled func(childComplexity int) int + Tenant func(childComplexity int) int + } + ConfigAuthMethodOauthTwitter struct { ConsumerKey func(childComplexity int) int ConsumerSecret func(childComplexity int) int @@ -1086,6 +1094,13 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin return e.complexity.ConfigAuthMethodOauth.Discord(childComplexity), true + case "ConfigAuthMethodOauth.entraid": + if e.complexity.ConfigAuthMethodOauth.Entraid == nil { + break + } + + return e.complexity.ConfigAuthMethodOauth.Entraid(childComplexity), true + case "ConfigAuthMethodOauth.facebook": if e.complexity.ConfigAuthMethodOauth.Facebook == nil { break @@ -1240,6 +1255,34 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin return e.complexity.ConfigAuthMethodOauthAzuread.Tenant(childComplexity), true + case "ConfigAuthMethodOauthEntraid.clientId": + if e.complexity.ConfigAuthMethodOauthEntraid.ClientId == nil { + break + } + + return e.complexity.ConfigAuthMethodOauthEntraid.ClientId(childComplexity), true + + case "ConfigAuthMethodOauthEntraid.clientSecret": + if e.complexity.ConfigAuthMethodOauthEntraid.ClientSecret == nil { + break + } + + return e.complexity.ConfigAuthMethodOauthEntraid.ClientSecret(childComplexity), true + + case "ConfigAuthMethodOauthEntraid.enabled": + if e.complexity.ConfigAuthMethodOauthEntraid.Enabled == nil { + break + } + + return e.complexity.ConfigAuthMethodOauthEntraid.Enabled(childComplexity), true + + case "ConfigAuthMethodOauthEntraid.tenant": + if e.complexity.ConfigAuthMethodOauthEntraid.Tenant == nil { + break + } + + return e.complexity.ConfigAuthMethodOauthEntraid.Tenant(childComplexity), true + case "ConfigAuthMethodOauthTwitter.consumerKey": if e.complexity.ConfigAuthMethodOauthTwitter.ConsumerKey == nil { break @@ -3556,6 +3599,8 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputConfigAuthMethodOauthAzureadComparisonExp, ec.unmarshalInputConfigAuthMethodOauthAzureadInsertInput, ec.unmarshalInputConfigAuthMethodOauthComparisonExp, + ec.unmarshalInputConfigAuthMethodOauthEntraidComparisonExp, + ec.unmarshalInputConfigAuthMethodOauthEntraidInsertInput, ec.unmarshalInputConfigAuthMethodOauthInsertInput, ec.unmarshalInputConfigAuthMethodOauthTwitterComparisonExp, ec.unmarshalInputConfigAuthMethodOauthTwitterInsertInput, @@ -4546,6 +4591,10 @@ type ConfigAuthMethodOauth { discord: ConfigStandardOauthProviderWithScope """ + """ + entraid: ConfigAuthMethodOauthEntraid + """ + """ facebook: ConfigStandardOauthProviderWithScope """ @@ -4595,6 +4644,7 @@ input ConfigAuthMethodOauthUpdateInput { azuread: ConfigAuthMethodOauthAzureadUpdateInput bitbucket: ConfigStandardOauthProviderUpdateInput discord: ConfigStandardOauthProviderWithScopeUpdateInput + entraid: ConfigAuthMethodOauthEntraidUpdateInput facebook: ConfigStandardOauthProviderWithScopeUpdateInput github: ConfigStandardOauthProviderWithScopeUpdateInput gitlab: ConfigStandardOauthProviderWithScopeUpdateInput @@ -4613,6 +4663,7 @@ input ConfigAuthMethodOauthInsertInput { azuread: ConfigAuthMethodOauthAzureadInsertInput bitbucket: ConfigStandardOauthProviderInsertInput discord: ConfigStandardOauthProviderWithScopeInsertInput + entraid: ConfigAuthMethodOauthEntraidInsertInput facebook: ConfigStandardOauthProviderWithScopeInsertInput github: ConfigStandardOauthProviderWithScopeInsertInput gitlab: ConfigStandardOauthProviderWithScopeInsertInput @@ -4634,6 +4685,7 @@ input ConfigAuthMethodOauthComparisonExp { azuread: ConfigAuthMethodOauthAzureadComparisonExp bitbucket: ConfigStandardOauthProviderComparisonExp discord: ConfigStandardOauthProviderWithScopeComparisonExp + entraid: ConfigAuthMethodOauthEntraidComparisonExp facebook: ConfigStandardOauthProviderWithScopeComparisonExp github: ConfigStandardOauthProviderWithScopeComparisonExp gitlab: ConfigStandardOauthProviderWithScopeComparisonExp @@ -4762,6 +4814,52 @@ input ConfigAuthMethodOauthAzureadComparisonExp { """ +""" +type ConfigAuthMethodOauthEntraid { + """ + + """ + tenant: String + """ + + """ + enabled: Boolean + """ + + """ + clientId: String + """ + + """ + clientSecret: String +} + +input ConfigAuthMethodOauthEntraidUpdateInput { + tenant: String + enabled: Boolean + clientId: String + clientSecret: String +} + +input ConfigAuthMethodOauthEntraidInsertInput { + tenant: String + enabled: Boolean + clientId: String + clientSecret: String +} + +input ConfigAuthMethodOauthEntraidComparisonExp { + _and: [ConfigAuthMethodOauthEntraidComparisonExp!] + _not: ConfigAuthMethodOauthEntraidComparisonExp + _or: [ConfigAuthMethodOauthEntraidComparisonExp!] + tenant: ConfigStringComparisonExp + enabled: ConfigBooleanComparisonExp + clientId: ConfigStringComparisonExp + clientSecret: ConfigStringComparisonExp +} + +""" + """ type ConfigAuthMethodOauthTwitter { """ @@ -11759,6 +11857,8 @@ func (ec *executionContext) fieldContext_ConfigAuthMethod_oauth(_ context.Contex return ec.fieldContext_ConfigAuthMethodOauth_bitbucket(ctx, field) case "discord": return ec.fieldContext_ConfigAuthMethodOauth_discord(ctx, field) + case "entraid": + return ec.fieldContext_ConfigAuthMethodOauth_entraid(ctx, field) case "facebook": return ec.fieldContext_ConfigAuthMethodOauth_facebook(ctx, field) case "github": @@ -12252,6 +12352,57 @@ func (ec *executionContext) fieldContext_ConfigAuthMethodOauth_discord(_ context return fc, nil } +func (ec *executionContext) _ConfigAuthMethodOauth_entraid(ctx context.Context, field graphql.CollectedField, obj *model.ConfigAuthMethodOauth) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConfigAuthMethodOauth_entraid(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Entraid, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.ConfigAuthMethodOauthEntraid) + fc.Result = res + return ec.marshalOConfigAuthMethodOauthEntraid2ᚖgithubᚗcomᚋnhostᚋbeᚋservicesᚋmimirᚋmodelᚐConfigAuthMethodOauthEntraid(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ConfigAuthMethodOauth_entraid(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ConfigAuthMethodOauth", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "tenant": + return ec.fieldContext_ConfigAuthMethodOauthEntraid_tenant(ctx, field) + case "enabled": + return ec.fieldContext_ConfigAuthMethodOauthEntraid_enabled(ctx, field) + case "clientId": + return ec.fieldContext_ConfigAuthMethodOauthEntraid_clientId(ctx, field) + case "clientSecret": + return ec.fieldContext_ConfigAuthMethodOauthEntraid_clientSecret(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ConfigAuthMethodOauthEntraid", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _ConfigAuthMethodOauth_facebook(ctx context.Context, field graphql.CollectedField, obj *model.ConfigAuthMethodOauth) (ret graphql.Marshaler) { fc, err := ec.fieldContext_ConfigAuthMethodOauth_facebook(ctx, field) if err != nil { @@ -13282,6 +13433,170 @@ func (ec *executionContext) fieldContext_ConfigAuthMethodOauthAzuread_clientSecr return fc, nil } +func (ec *executionContext) _ConfigAuthMethodOauthEntraid_tenant(ctx context.Context, field graphql.CollectedField, obj *model.ConfigAuthMethodOauthEntraid) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConfigAuthMethodOauthEntraid_tenant(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Tenant, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ConfigAuthMethodOauthEntraid_tenant(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ConfigAuthMethodOauthEntraid", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ConfigAuthMethodOauthEntraid_enabled(ctx context.Context, field graphql.CollectedField, obj *model.ConfigAuthMethodOauthEntraid) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConfigAuthMethodOauthEntraid_enabled(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Enabled, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*bool) + fc.Result = res + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ConfigAuthMethodOauthEntraid_enabled(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ConfigAuthMethodOauthEntraid", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ConfigAuthMethodOauthEntraid_clientId(ctx context.Context, field graphql.CollectedField, obj *model.ConfigAuthMethodOauthEntraid) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConfigAuthMethodOauthEntraid_clientId(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ClientId, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ConfigAuthMethodOauthEntraid_clientId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ConfigAuthMethodOauthEntraid", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ConfigAuthMethodOauthEntraid_clientSecret(ctx context.Context, field graphql.CollectedField, obj *model.ConfigAuthMethodOauthEntraid) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConfigAuthMethodOauthEntraid_clientSecret(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ClientSecret, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ConfigAuthMethodOauthEntraid_clientSecret(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ConfigAuthMethodOauthEntraid", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _ConfigAuthMethodOauthTwitter_enabled(ctx context.Context, field graphql.CollectedField, obj *model.ConfigAuthMethodOauthTwitter) (ret graphql.Marshaler) { fc, err := ec.fieldContext_ConfigAuthMethodOauthTwitter_enabled(ctx, field) if err != nil { @@ -31073,7 +31388,7 @@ func (ec *executionContext) unmarshalInputConfigAuthMethodOauthComparisonExp(ctx asMap[k] = v } - fieldsInOrder := [...]string{"_and", "_not", "_or", "apple", "azuread", "bitbucket", "discord", "facebook", "github", "gitlab", "google", "linkedin", "spotify", "strava", "twitch", "twitter", "windowslive", "workos"} + fieldsInOrder := [...]string{"_and", "_not", "_or", "apple", "azuread", "bitbucket", "discord", "entraid", "facebook", "github", "gitlab", "google", "linkedin", "spotify", "strava", "twitch", "twitter", "windowslive", "workos"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -31129,6 +31444,13 @@ func (ec *executionContext) unmarshalInputConfigAuthMethodOauthComparisonExp(ctx return it, err } it.Discord = data + case "entraid": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entraid")) + data, err := ec.unmarshalOConfigAuthMethodOauthEntraidComparisonExp2ᚖgithubᚗcomᚋnhostᚋbeᚋservicesᚋmimirᚋmodelᚐConfigAuthMethodOauthEntraidComparisonExp(ctx, v) + if err != nil { + return it, err + } + it.Entraid = data case "facebook": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("facebook")) data, err := ec.unmarshalOConfigStandardOauthProviderWithScopeComparisonExp2ᚖgithubᚗcomᚋnhostᚋbeᚋservicesᚋmimirᚋmodelᚐConfigStandardOauthProviderWithScopeComparisonExp(ctx, v) @@ -31212,6 +31534,123 @@ func (ec *executionContext) unmarshalInputConfigAuthMethodOauthComparisonExp(ctx return it, nil } +func (ec *executionContext) unmarshalInputConfigAuthMethodOauthEntraidComparisonExp(ctx context.Context, obj any) (model.ConfigAuthMethodOauthEntraidComparisonExp, error) { + var it model.ConfigAuthMethodOauthEntraidComparisonExp + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"_and", "_not", "_or", "tenant", "enabled", "clientId", "clientSecret"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalOConfigAuthMethodOauthEntraidComparisonExp2ᚕᚖgithubᚗcomᚋnhostᚋbeᚋservicesᚋmimirᚋmodelᚐConfigAuthMethodOauthEntraidComparisonExpᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalOConfigAuthMethodOauthEntraidComparisonExp2ᚖgithubᚗcomᚋnhostᚋbeᚋservicesᚋmimirᚋmodelᚐConfigAuthMethodOauthEntraidComparisonExp(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalOConfigAuthMethodOauthEntraidComparisonExp2ᚕᚖgithubᚗcomᚋnhostᚋbeᚋservicesᚋmimirᚋmodelᚐConfigAuthMethodOauthEntraidComparisonExpᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "tenant": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tenant")) + data, err := ec.unmarshalOConfigStringComparisonExp2ᚖgithubᚗcomᚋnhostᚋbeᚋservicesᚋmimirᚋmodelᚐGenericComparisonExp(ctx, v) + if err != nil { + return it, err + } + it.Tenant = data + case "enabled": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) + data, err := ec.unmarshalOConfigBooleanComparisonExp2ᚖgithubᚗcomᚋnhostᚋbeᚋservicesᚋmimirᚋmodelᚐGenericComparisonExp(ctx, v) + if err != nil { + return it, err + } + it.Enabled = data + case "clientId": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientId")) + data, err := ec.unmarshalOConfigStringComparisonExp2ᚖgithubᚗcomᚋnhostᚋbeᚋservicesᚋmimirᚋmodelᚐGenericComparisonExp(ctx, v) + if err != nil { + return it, err + } + it.ClientId = data + case "clientSecret": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecret")) + data, err := ec.unmarshalOConfigStringComparisonExp2ᚖgithubᚗcomᚋnhostᚋbeᚋservicesᚋmimirᚋmodelᚐGenericComparisonExp(ctx, v) + if err != nil { + return it, err + } + it.ClientSecret = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputConfigAuthMethodOauthEntraidInsertInput(ctx context.Context, obj any) (model.ConfigAuthMethodOauthEntraidInsertInput, error) { + var it model.ConfigAuthMethodOauthEntraidInsertInput + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tenant", "enabled", "clientId", "clientSecret"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tenant": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tenant")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Tenant = data + case "enabled": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Enabled = data + case "clientId": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientId")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientId = data + case "clientSecret": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecret")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientSecret = data + } + } + + return it, nil +} + func (ec *executionContext) unmarshalInputConfigAuthMethodOauthInsertInput(ctx context.Context, obj any) (model.ConfigAuthMethodOauthInsertInput, error) { var it model.ConfigAuthMethodOauthInsertInput asMap := map[string]any{} @@ -31219,7 +31658,7 @@ func (ec *executionContext) unmarshalInputConfigAuthMethodOauthInsertInput(ctx c asMap[k] = v } - fieldsInOrder := [...]string{"apple", "azuread", "bitbucket", "discord", "facebook", "github", "gitlab", "google", "linkedin", "spotify", "strava", "twitch", "twitter", "windowslive", "workos"} + fieldsInOrder := [...]string{"apple", "azuread", "bitbucket", "discord", "entraid", "facebook", "github", "gitlab", "google", "linkedin", "spotify", "strava", "twitch", "twitter", "windowslive", "workos"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -31254,6 +31693,13 @@ func (ec *executionContext) unmarshalInputConfigAuthMethodOauthInsertInput(ctx c return it, err } it.Discord = data + case "entraid": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entraid")) + data, err := ec.unmarshalOConfigAuthMethodOauthEntraidInsertInput2ᚖgithubᚗcomᚋnhostᚋbeᚋservicesᚋmimirᚋmodelᚐConfigAuthMethodOauthEntraidInsertInput(ctx, v) + if err != nil { + return it, err + } + it.Entraid = data case "facebook": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("facebook")) data, err := ec.unmarshalOConfigStandardOauthProviderWithScopeInsertInput2ᚖgithubᚗcomᚋnhostᚋbeᚋservicesᚋmimirᚋmodelᚐConfigStandardOauthProviderWithScopeInsertInput(ctx, v) @@ -41818,6 +42264,8 @@ func (ec *executionContext) _ConfigAuthMethodOauth(ctx context.Context, sel ast. out.Values[i] = ec._ConfigAuthMethodOauth_bitbucket(ctx, field, obj) case "discord": out.Values[i] = ec._ConfigAuthMethodOauth_discord(ctx, field, obj) + case "entraid": + out.Values[i] = ec._ConfigAuthMethodOauth_entraid(ctx, field, obj) case "facebook": out.Values[i] = ec._ConfigAuthMethodOauth_facebook(ctx, field, obj) case "github": @@ -41953,6 +42401,48 @@ func (ec *executionContext) _ConfigAuthMethodOauthAzuread(ctx context.Context, s return out } +var configAuthMethodOauthEntraidImplementors = []string{"ConfigAuthMethodOauthEntraid"} + +func (ec *executionContext) _ConfigAuthMethodOauthEntraid(ctx context.Context, sel ast.SelectionSet, obj *model.ConfigAuthMethodOauthEntraid) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, configAuthMethodOauthEntraidImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ConfigAuthMethodOauthEntraid") + case "tenant": + out.Values[i] = ec._ConfigAuthMethodOauthEntraid_tenant(ctx, field, obj) + case "enabled": + out.Values[i] = ec._ConfigAuthMethodOauthEntraid_enabled(ctx, field, obj) + case "clientId": + out.Values[i] = ec._ConfigAuthMethodOauthEntraid_clientId(ctx, field, obj) + case "clientSecret": + out.Values[i] = ec._ConfigAuthMethodOauthEntraid_clientSecret(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + var configAuthMethodOauthTwitterImplementors = []string{"ConfigAuthMethodOauthTwitter"} func (ec *executionContext) _ConfigAuthMethodOauthTwitter(ctx context.Context, sel ast.SelectionSet, obj *model.ConfigAuthMethodOauthTwitter) graphql.Marshaler { @@ -46693,6 +47183,11 @@ func (ec *executionContext) unmarshalNConfigAuthMethodOauthComparisonExp2ᚖgith return &res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) unmarshalNConfigAuthMethodOauthEntraidComparisonExp2ᚖgithubᚗcomᚋnhostᚋbeᚋservicesᚋmimirᚋmodelᚐConfigAuthMethodOauthEntraidComparisonExp(ctx context.Context, v any) (*model.ConfigAuthMethodOauthEntraidComparisonExp, error) { + res, err := ec.unmarshalInputConfigAuthMethodOauthEntraidComparisonExp(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) unmarshalNConfigAuthMethodOauthTwitterComparisonExp2ᚖgithubᚗcomᚋnhostᚋbeᚋservicesᚋmimirᚋmodelᚐConfigAuthMethodOauthTwitterComparisonExp(ctx context.Context, v any) (*model.ConfigAuthMethodOauthTwitterComparisonExp, error) { res, err := ec.unmarshalInputConfigAuthMethodOauthTwitterComparisonExp(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) @@ -49036,6 +49531,56 @@ func (ec *executionContext) unmarshalOConfigAuthMethodOauthComparisonExp2ᚖgith return &res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) marshalOConfigAuthMethodOauthEntraid2ᚖgithubᚗcomᚋnhostᚋbeᚋservicesᚋmimirᚋmodelᚐConfigAuthMethodOauthEntraid(ctx context.Context, sel ast.SelectionSet, v *model.ConfigAuthMethodOauthEntraid) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._ConfigAuthMethodOauthEntraid(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOConfigAuthMethodOauthEntraidComparisonExp2ᚕᚖgithubᚗcomᚋnhostᚋbeᚋservicesᚋmimirᚋmodelᚐConfigAuthMethodOauthEntraidComparisonExpᚄ(ctx context.Context, v any) ([]*model.ConfigAuthMethodOauthEntraidComparisonExp, error) { + if v == nil { + return nil, nil + } + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]*model.ConfigAuthMethodOauthEntraidComparisonExp, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNConfigAuthMethodOauthEntraidComparisonExp2ᚖgithubᚗcomᚋnhostᚋbeᚋservicesᚋmimirᚋmodelᚐConfigAuthMethodOauthEntraidComparisonExp(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOConfigAuthMethodOauthEntraidComparisonExp2ᚖgithubᚗcomᚋnhostᚋbeᚋservicesᚋmimirᚋmodelᚐConfigAuthMethodOauthEntraidComparisonExp(ctx context.Context, v any) (*model.ConfigAuthMethodOauthEntraidComparisonExp, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputConfigAuthMethodOauthEntraidComparisonExp(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOConfigAuthMethodOauthEntraidInsertInput2ᚖgithubᚗcomᚋnhostᚋbeᚋservicesᚋmimirᚋmodelᚐConfigAuthMethodOauthEntraidInsertInput(ctx context.Context, v any) (*model.ConfigAuthMethodOauthEntraidInsertInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputConfigAuthMethodOauthEntraidInsertInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOConfigAuthMethodOauthEntraidUpdateInput2ᚖgithubᚗcomᚋnhostᚋbeᚋservicesᚋmimirᚋmodelᚐConfigAuthMethodOauthEntraidUpdateInput(ctx context.Context, v any) (*model.ConfigAuthMethodOauthEntraidUpdateInput, error) { + if v == nil { + return nil, nil + } + var res = new(model.ConfigAuthMethodOauthEntraidUpdateInput) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) unmarshalOConfigAuthMethodOauthInsertInput2ᚖgithubᚗcomᚋnhostᚋbeᚋservicesᚋmimirᚋmodelᚐConfigAuthMethodOauthInsertInput(ctx context.Context, v any) (*model.ConfigAuthMethodOauthInsertInput, error) { if v == nil { return nil, nil diff --git a/vendor/github.com/nhost/be/services/mimir/graph/m_change_database_version.go b/vendor/github.com/nhost/be/services/mimir/graph/m_change_database_version.go index 99697974b..e537af7d3 100644 --- a/vendor/github.com/nhost/be/services/mimir/graph/m_change_database_version.go +++ b/vendor/github.com/nhost/be/services/mimir/graph/m_change_database_version.go @@ -51,7 +51,7 @@ func (r *mutationResolver) changeDatabaseVersionValidate( } func (r *mutationResolver) changeDatabaseVersion( - ctx context.Context, appID string, version string, _ *bool, + ctx context.Context, appID string, version string, force *bool, ) (bool, error) { r.mu.Lock() defer r.mu.Unlock() @@ -82,8 +82,10 @@ func (r *mutationResolver) changeDatabaseVersion( return false, err } - if err := r.changeDatabaseVersionValidate(ctx, oldApp, newApp); err != nil { - return false, err + if !deptr(force) { + if err := r.changeDatabaseVersionValidate(ctx, oldApp, newApp); err != nil { + return false, err + } } logger := nhcontext.LoggerFromContext(ctx).WithField("app_id", appID) diff --git a/vendor/github.com/nhost/be/services/mimir/model/cuegraph_gen.go b/vendor/github.com/nhost/be/services/mimir/model/cuegraph_gen.go index b12e570f3..f8a8224ed 100644 --- a/vendor/github.com/nhost/be/services/mimir/model/cuegraph_gen.go +++ b/vendor/github.com/nhost/be/services/mimir/model/cuegraph_gen.go @@ -2827,6 +2827,8 @@ type ConfigAuthMethodOauth struct { Discord *ConfigStandardOauthProviderWithScope `json:"discord,omitempty" toml:"discord,omitempty"` + Entraid *ConfigAuthMethodOauthEntraid `json:"entraid,omitempty" toml:"entraid,omitempty"` + Facebook *ConfigStandardOauthProviderWithScope `json:"facebook,omitempty" toml:"facebook,omitempty"` Github *ConfigStandardOauthProviderWithScope `json:"github,omitempty" toml:"github,omitempty"` @@ -2864,6 +2866,9 @@ func (o *ConfigAuthMethodOauth) MarshalJSON() ([]byte, error) { if o.Discord != nil { m["discord"] = o.Discord } + if o.Entraid != nil { + m["entraid"] = o.Entraid + } if o.Facebook != nil { m["facebook"] = o.Facebook } @@ -2928,6 +2933,13 @@ func (o *ConfigAuthMethodOauth) GetDiscord() *ConfigStandardOauthProviderWithSco return o.Discord } +func (o *ConfigAuthMethodOauth) GetEntraid() *ConfigAuthMethodOauthEntraid { + if o == nil { + return nil + } + return o.Entraid +} + func (o *ConfigAuthMethodOauth) GetFacebook() *ConfigStandardOauthProviderWithScope { if o == nil { return nil @@ -3014,6 +3026,8 @@ type ConfigAuthMethodOauthUpdateInput struct { IsSetBitbucket bool `json:"-"` Discord *ConfigStandardOauthProviderWithScopeUpdateInput `json:"discord,omitempty" toml:"discord,omitempty"` IsSetDiscord bool `json:"-"` + Entraid *ConfigAuthMethodOauthEntraidUpdateInput `json:"entraid,omitempty" toml:"entraid,omitempty"` + IsSetEntraid bool `json:"-"` Facebook *ConfigStandardOauthProviderWithScopeUpdateInput `json:"facebook,omitempty" toml:"facebook,omitempty"` IsSetFacebook bool `json:"-"` Github *ConfigStandardOauthProviderWithScopeUpdateInput `json:"github,omitempty" toml:"github,omitempty"` @@ -3083,6 +3097,16 @@ func (o *ConfigAuthMethodOauthUpdateInput) UnmarshalGQL(v interface{}) error { } o.IsSetDiscord = true } + if x, ok := m["entraid"]; ok { + if x != nil { + t := &ConfigAuthMethodOauthEntraidUpdateInput{} + if err := t.UnmarshalGQL(x); err != nil { + return err + } + o.Entraid = t + } + o.IsSetEntraid = true + } if x, ok := m["facebook"]; ok { if x != nil { t := &ConfigStandardOauthProviderWithScopeUpdateInput{} @@ -3232,6 +3256,13 @@ func (o *ConfigAuthMethodOauthUpdateInput) GetDiscord() *ConfigStandardOauthProv return o.Discord } +func (o *ConfigAuthMethodOauthUpdateInput) GetEntraid() *ConfigAuthMethodOauthEntraidUpdateInput { + if o == nil { + return nil + } + return o.Entraid +} + func (o *ConfigAuthMethodOauthUpdateInput) GetFacebook() *ConfigStandardOauthProviderWithScopeUpdateInput { if o == nil { return nil @@ -3353,6 +3384,16 @@ func (s *ConfigAuthMethodOauth) Update(v *ConfigAuthMethodOauthUpdateInput) { s.Discord.Update(v.Discord) } } + if v.IsSetEntraid || v.Entraid != nil { + if v.Entraid == nil { + s.Entraid = nil + } else { + if s.Entraid == nil { + s.Entraid = &ConfigAuthMethodOauthEntraid{} + } + s.Entraid.Update(v.Entraid) + } + } if v.IsSetFacebook || v.Facebook != nil { if v.Facebook == nil { s.Facebook = nil @@ -3470,6 +3511,7 @@ type ConfigAuthMethodOauthInsertInput struct { Azuread *ConfigAuthMethodOauthAzureadInsertInput `json:"azuread,omitempty" toml:"azuread,omitempty"` Bitbucket *ConfigStandardOauthProviderInsertInput `json:"bitbucket,omitempty" toml:"bitbucket,omitempty"` Discord *ConfigStandardOauthProviderWithScopeInsertInput `json:"discord,omitempty" toml:"discord,omitempty"` + Entraid *ConfigAuthMethodOauthEntraidInsertInput `json:"entraid,omitempty" toml:"entraid,omitempty"` Facebook *ConfigStandardOauthProviderWithScopeInsertInput `json:"facebook,omitempty" toml:"facebook,omitempty"` Github *ConfigStandardOauthProviderWithScopeInsertInput `json:"github,omitempty" toml:"github,omitempty"` Gitlab *ConfigStandardOauthProviderWithScopeInsertInput `json:"gitlab,omitempty" toml:"gitlab,omitempty"` @@ -3511,6 +3553,13 @@ func (o *ConfigAuthMethodOauthInsertInput) GetDiscord() *ConfigStandardOauthProv return o.Discord } +func (o *ConfigAuthMethodOauthInsertInput) GetEntraid() *ConfigAuthMethodOauthEntraidInsertInput { + if o == nil { + return nil + } + return o.Entraid +} + func (o *ConfigAuthMethodOauthInsertInput) GetFacebook() *ConfigStandardOauthProviderWithScopeInsertInput { if o == nil { return nil @@ -3613,6 +3662,12 @@ func (s *ConfigAuthMethodOauth) Insert(v *ConfigAuthMethodOauthInsertInput) { } s.Discord.Insert(v.Discord) } + if v.Entraid != nil { + if s.Entraid == nil { + s.Entraid = &ConfigAuthMethodOauthEntraid{} + } + s.Entraid.Insert(v.Entraid) + } if v.Facebook != nil { if s.Facebook == nil { s.Facebook = &ConfigStandardOauthProviderWithScope{} @@ -3691,6 +3746,7 @@ func (s *ConfigAuthMethodOauth) Clone() *ConfigAuthMethodOauth { v.Azuread = s.Azuread.Clone() v.Bitbucket = s.Bitbucket.Clone() v.Discord = s.Discord.Clone() + v.Entraid = s.Entraid.Clone() v.Facebook = s.Facebook.Clone() v.Github = s.Github.Clone() v.Gitlab = s.Gitlab.Clone() @@ -3713,6 +3769,7 @@ type ConfigAuthMethodOauthComparisonExp struct { Azuread *ConfigAuthMethodOauthAzureadComparisonExp `json:"azuread,omitempty"` Bitbucket *ConfigStandardOauthProviderComparisonExp `json:"bitbucket,omitempty"` Discord *ConfigStandardOauthProviderWithScopeComparisonExp `json:"discord,omitempty"` + Entraid *ConfigAuthMethodOauthEntraidComparisonExp `json:"entraid,omitempty"` Facebook *ConfigStandardOauthProviderWithScopeComparisonExp `json:"facebook,omitempty"` Github *ConfigStandardOauthProviderWithScopeComparisonExp `json:"github,omitempty"` Gitlab *ConfigStandardOauthProviderWithScopeComparisonExp `json:"gitlab,omitempty"` @@ -3737,6 +3794,7 @@ func (exp *ConfigAuthMethodOauthComparisonExp) Matches(o *ConfigAuthMethodOauth) Azuread: &ConfigAuthMethodOauthAzuread{}, Bitbucket: &ConfigStandardOauthProvider{}, Discord: &ConfigStandardOauthProviderWithScope{}, + Entraid: &ConfigAuthMethodOauthEntraid{}, Facebook: &ConfigStandardOauthProviderWithScope{}, Github: &ConfigStandardOauthProviderWithScope{}, Gitlab: &ConfigStandardOauthProviderWithScope{}, @@ -3762,6 +3820,9 @@ func (exp *ConfigAuthMethodOauthComparisonExp) Matches(o *ConfigAuthMethodOauth) if !exp.Discord.Matches(o.Discord) { return false } + if !exp.Entraid.Matches(o.Entraid) { + return false + } if !exp.Facebook.Matches(o.Facebook) { return false } @@ -4594,6 +4655,303 @@ func (exp *ConfigAuthMethodOauthAzureadComparisonExp) Matches(o *ConfigAuthMetho return true } +type ConfigAuthMethodOauthEntraid struct { + Tenant *string `json:"tenant" toml:"tenant"` + + Enabled *bool `json:"enabled" toml:"enabled"` + + ClientId *string `json:"clientId" toml:"clientId"` + + ClientSecret *string `json:"clientSecret" toml:"clientSecret"` +} + +func (o *ConfigAuthMethodOauthEntraid) MarshalJSON() ([]byte, error) { + m := make(map[string]any) + if o.Tenant != nil { + m["tenant"] = o.Tenant + } + if o.Enabled != nil { + m["enabled"] = o.Enabled + } + if o.ClientId != nil { + m["clientId"] = o.ClientId + } + if o.ClientSecret != nil { + m["clientSecret"] = o.ClientSecret + } + return json.Marshal(m) +} + +func (o *ConfigAuthMethodOauthEntraid) GetTenant() *string { + if o == nil { + o = &ConfigAuthMethodOauthEntraid{} + } + return o.Tenant +} + +func (o *ConfigAuthMethodOauthEntraid) GetEnabled() *bool { + if o == nil { + o = &ConfigAuthMethodOauthEntraid{} + } + return o.Enabled +} + +func (o *ConfigAuthMethodOauthEntraid) GetClientId() *string { + if o == nil { + o = &ConfigAuthMethodOauthEntraid{} + } + return o.ClientId +} + +func (o *ConfigAuthMethodOauthEntraid) GetClientSecret() *string { + if o == nil { + o = &ConfigAuthMethodOauthEntraid{} + } + return o.ClientSecret +} + +type ConfigAuthMethodOauthEntraidUpdateInput struct { + Tenant *string `json:"tenant,omitempty" toml:"tenant,omitempty"` + IsSetTenant bool `json:"-"` + Enabled *bool `json:"enabled,omitempty" toml:"enabled,omitempty"` + IsSetEnabled bool `json:"-"` + ClientId *string `json:"clientId,omitempty" toml:"clientId,omitempty"` + IsSetClientId bool `json:"-"` + ClientSecret *string `json:"clientSecret,omitempty" toml:"clientSecret,omitempty"` + IsSetClientSecret bool `json:"-"` +} + +func (o *ConfigAuthMethodOauthEntraidUpdateInput) UnmarshalGQL(v interface{}) error { + m, ok := v.(map[string]any) + if !ok { + return fmt.Errorf("must be map[string]interface{}, got %T", v) + } + if v, ok := m["tenant"]; ok { + if v == nil { + o.Tenant = nil + } else { + // clearly a not very efficient shortcut + b, err := json.Marshal(v) + if err != nil { + return err + } + var x string + if err := json.Unmarshal(b, &x); err != nil { + return err + } + o.Tenant = &x + } + o.IsSetTenant = true + } + if v, ok := m["enabled"]; ok { + if v == nil { + o.Enabled = nil + } else { + // clearly a not very efficient shortcut + b, err := json.Marshal(v) + if err != nil { + return err + } + var x bool + if err := json.Unmarshal(b, &x); err != nil { + return err + } + o.Enabled = &x + } + o.IsSetEnabled = true + } + if v, ok := m["clientId"]; ok { + if v == nil { + o.ClientId = nil + } else { + // clearly a not very efficient shortcut + b, err := json.Marshal(v) + if err != nil { + return err + } + var x string + if err := json.Unmarshal(b, &x); err != nil { + return err + } + o.ClientId = &x + } + o.IsSetClientId = true + } + if v, ok := m["clientSecret"]; ok { + if v == nil { + o.ClientSecret = nil + } else { + // clearly a not very efficient shortcut + b, err := json.Marshal(v) + if err != nil { + return err + } + var x string + if err := json.Unmarshal(b, &x); err != nil { + return err + } + o.ClientSecret = &x + } + o.IsSetClientSecret = true + } + + return nil +} + +func (o *ConfigAuthMethodOauthEntraidUpdateInput) MarshalGQL(w io.Writer) { + enc := json.NewEncoder(w) + if err := enc.Encode(o); err != nil { + panic(err) + } +} + +func (o *ConfigAuthMethodOauthEntraidUpdateInput) GetTenant() *string { + if o == nil { + o = &ConfigAuthMethodOauthEntraidUpdateInput{} + } + return o.Tenant +} + +func (o *ConfigAuthMethodOauthEntraidUpdateInput) GetEnabled() *bool { + if o == nil { + o = &ConfigAuthMethodOauthEntraidUpdateInput{} + } + return o.Enabled +} + +func (o *ConfigAuthMethodOauthEntraidUpdateInput) GetClientId() *string { + if o == nil { + o = &ConfigAuthMethodOauthEntraidUpdateInput{} + } + return o.ClientId +} + +func (o *ConfigAuthMethodOauthEntraidUpdateInput) GetClientSecret() *string { + if o == nil { + o = &ConfigAuthMethodOauthEntraidUpdateInput{} + } + return o.ClientSecret +} + +func (s *ConfigAuthMethodOauthEntraid) Update(v *ConfigAuthMethodOauthEntraidUpdateInput) { + if v == nil { + return + } + if v.IsSetTenant || v.Tenant != nil { + s.Tenant = v.Tenant + } + if v.IsSetEnabled || v.Enabled != nil { + s.Enabled = v.Enabled + } + if v.IsSetClientId || v.ClientId != nil { + s.ClientId = v.ClientId + } + if v.IsSetClientSecret || v.ClientSecret != nil { + s.ClientSecret = v.ClientSecret + } +} + +type ConfigAuthMethodOauthEntraidInsertInput struct { + Tenant *string `json:"tenant,omitempty" toml:"tenant,omitempty"` + Enabled *bool `json:"enabled,omitempty" toml:"enabled,omitempty"` + ClientId *string `json:"clientId,omitempty" toml:"clientId,omitempty"` + ClientSecret *string `json:"clientSecret,omitempty" toml:"clientSecret,omitempty"` +} + +func (o *ConfigAuthMethodOauthEntraidInsertInput) GetTenant() *string { + if o == nil { + o = &ConfigAuthMethodOauthEntraidInsertInput{} + } + return o.Tenant +} + +func (o *ConfigAuthMethodOauthEntraidInsertInput) GetEnabled() *bool { + if o == nil { + o = &ConfigAuthMethodOauthEntraidInsertInput{} + } + return o.Enabled +} + +func (o *ConfigAuthMethodOauthEntraidInsertInput) GetClientId() *string { + if o == nil { + o = &ConfigAuthMethodOauthEntraidInsertInput{} + } + return o.ClientId +} + +func (o *ConfigAuthMethodOauthEntraidInsertInput) GetClientSecret() *string { + if o == nil { + o = &ConfigAuthMethodOauthEntraidInsertInput{} + } + return o.ClientSecret +} + +func (s *ConfigAuthMethodOauthEntraid) Insert(v *ConfigAuthMethodOauthEntraidInsertInput) { + s.Tenant = v.Tenant + s.Enabled = v.Enabled + s.ClientId = v.ClientId + s.ClientSecret = v.ClientSecret +} + +func (s *ConfigAuthMethodOauthEntraid) Clone() *ConfigAuthMethodOauthEntraid { + if s == nil { + return nil + } + + v := &ConfigAuthMethodOauthEntraid{} + v.Tenant = s.Tenant + v.Enabled = s.Enabled + v.ClientId = s.ClientId + v.ClientSecret = s.ClientSecret + return v +} + +type ConfigAuthMethodOauthEntraidComparisonExp struct { + And []*ConfigAuthMethodOauthEntraidComparisonExp `json:"_and,omitempty"` + Not *ConfigAuthMethodOauthEntraidComparisonExp `json:"_not,omitempty"` + Or []*ConfigAuthMethodOauthEntraidComparisonExp `json:"_or,omitempty"` + Tenant *ConfigStringComparisonExp `json:"tenant,omitempty"` + Enabled *ConfigBooleanComparisonExp `json:"enabled,omitempty"` + ClientId *ConfigStringComparisonExp `json:"clientId,omitempty"` + ClientSecret *ConfigStringComparisonExp `json:"clientSecret,omitempty"` +} + +func (exp *ConfigAuthMethodOauthEntraidComparisonExp) Matches(o *ConfigAuthMethodOauthEntraid) bool { + if exp == nil { + return true + } + + if o == nil { + o = &ConfigAuthMethodOauthEntraid{} + } + if o.Tenant != nil && !exp.Tenant.Matches(*o.Tenant) { + return false + } + if o.Enabled != nil && !exp.Enabled.Matches(*o.Enabled) { + return false + } + if o.ClientId != nil && !exp.ClientId.Matches(*o.ClientId) { + return false + } + if o.ClientSecret != nil && !exp.ClientSecret.Matches(*o.ClientSecret) { + return false + } + + if exp.And != nil && !all(exp.And, o) { + return false + } + + if exp.Or != nil && !or(exp.Or, o) { + return false + } + + if exp.Not != nil && exp.Not.Matches(o) { + return false + } + + return true +} + type ConfigAuthMethodOauthTwitter struct { Enabled *bool `json:"enabled" toml:"enabled"` diff --git a/vendor/github.com/nhost/be/services/mimir/schema/appconfig/hasura_auth.go b/vendor/github.com/nhost/be/services/mimir/schema/appconfig/hasura_auth.go index 6af72f8fa..238eb3a94 100644 --- a/vendor/github.com/nhost/be/services/mimir/schema/appconfig/hasura_auth.go +++ b/vendor/github.com/nhost/be/services/mimir/schema/appconfig/hasura_auth.go @@ -926,6 +926,62 @@ func HasuraAuthEnv( //nolint:funlen,cyclop,maintidx,gocyclo,gocognit }...) } + if unptr( //nolint:dupl + config.GetAuth().GetMethod().GetOauth().GetEntraid().GetEnabled(), + ) { + env = append(env, []EnvVar{ + { + Name: "AUTH_PROVIDER_ENTRAID_ENABLED", + Value: Stringify( + unptr( + config. + GetAuth(). + GetMethod(). + GetOauth(). + GetEntraid(). + GetEnabled(), + ), + ), + IsSecret: false, + SecretName: "", + }, + { + Name: "AUTH_PROVIDER_ENTRAID_CLIENT_ID", + Value: unptr( + config. + GetAuth(). + GetMethod(). + GetOauth(). + GetEntraid(). + GetClientId(), + ), + IsSecret: false, + SecretName: "", + }, + { + Name: "AUTH_PROVIDER_ENTRAID_CLIENT_SECRET", + SecretName: "", + Value: unptr( + config.GetAuth().GetMethod().GetOauth().GetEntraid().GetClientSecret(), + ), + IsSecret: false, + }, + { + Name: "AUTH_PROVIDER_ENTRAID_TENANT", + Value: unptr( + config. + GetAuth(). + GetMethod(). + GetOauth(). + GetEntraid(). + GetTenant(), + ), + IsSecret: false, + SecretName: "", + }, + }...) + } + if unptr( //nolint:dupl config.GetAuth().GetMethod().GetOauth().GetGitlab().GetEnabled(), ) { diff --git a/vendor/github.com/nhost/be/services/mimir/schema/schema.cue b/vendor/github.com/nhost/be/services/mimir/schema/schema.cue index 23303e007..b45c1c571 100644 --- a/vendor/github.com/nhost/be/services/mimir/schema/schema.cue +++ b/vendor/github.com/nhost/be/services/mimir/schema/schema.cue @@ -62,10 +62,9 @@ import ( postgres.resources.compute.cpu) >= 1000 & true @cuegraph(skip) _validateAllResourcesAreSetOrNot: ( - (hasura.resources.compute == _|_) == - (auth.resources.compute == _|_) == - (storage.resources.compute == _|_) == - (postgres.resources.compute == _|_) ) & true @cuegraph(skip) + ((hasura.resources.compute != _|_) == (auth.resources.compute != _|_)) && + ((auth.resources.compute != _|_) == (storage.resources.compute != _|_)) && + ((storage.resources.compute != _|_) == (postgres.resources.compute != _|_))) & true @cuegraph(skip) _validateNetworkingMustBeNullOrNotSet: !storage.resources.networking | storage.resources.networking == null @cuegraph(skip) @@ -447,6 +446,10 @@ import ( } bitbucket: #StandardOauthProvider discord: #StandardOauthProviderWithScope + entraid: { + #StandardOauthProvider + tenant: string | *"common" + } facebook: #StandardOauthProviderWithScope github: #StandardOauthProviderWithScope gitlab: #StandardOauthProviderWithScope diff --git a/vendor/github.com/nhost/be/services/mimir/schema/schema_gen.graphqls b/vendor/github.com/nhost/be/services/mimir/schema/schema_gen.graphqls index 33836c0f2..59fc9dd9e 100644 --- a/vendor/github.com/nhost/be/services/mimir/schema/schema_gen.graphqls +++ b/vendor/github.com/nhost/be/services/mimir/schema/schema_gen.graphqls @@ -550,6 +550,10 @@ type ConfigAuthMethodOauth { discord: ConfigStandardOauthProviderWithScope """ + """ + entraid: ConfigAuthMethodOauthEntraid + """ + """ facebook: ConfigStandardOauthProviderWithScope """ @@ -599,6 +603,7 @@ input ConfigAuthMethodOauthUpdateInput { azuread: ConfigAuthMethodOauthAzureadUpdateInput bitbucket: ConfigStandardOauthProviderUpdateInput discord: ConfigStandardOauthProviderWithScopeUpdateInput + entraid: ConfigAuthMethodOauthEntraidUpdateInput facebook: ConfigStandardOauthProviderWithScopeUpdateInput github: ConfigStandardOauthProviderWithScopeUpdateInput gitlab: ConfigStandardOauthProviderWithScopeUpdateInput @@ -617,6 +622,7 @@ input ConfigAuthMethodOauthInsertInput { azuread: ConfigAuthMethodOauthAzureadInsertInput bitbucket: ConfigStandardOauthProviderInsertInput discord: ConfigStandardOauthProviderWithScopeInsertInput + entraid: ConfigAuthMethodOauthEntraidInsertInput facebook: ConfigStandardOauthProviderWithScopeInsertInput github: ConfigStandardOauthProviderWithScopeInsertInput gitlab: ConfigStandardOauthProviderWithScopeInsertInput @@ -638,6 +644,7 @@ input ConfigAuthMethodOauthComparisonExp { azuread: ConfigAuthMethodOauthAzureadComparisonExp bitbucket: ConfigStandardOauthProviderComparisonExp discord: ConfigStandardOauthProviderWithScopeComparisonExp + entraid: ConfigAuthMethodOauthEntraidComparisonExp facebook: ConfigStandardOauthProviderWithScopeComparisonExp github: ConfigStandardOauthProviderWithScopeComparisonExp gitlab: ConfigStandardOauthProviderWithScopeComparisonExp @@ -766,6 +773,52 @@ input ConfigAuthMethodOauthAzureadComparisonExp { """ +""" +type ConfigAuthMethodOauthEntraid { + """ + + """ + tenant: String + """ + + """ + enabled: Boolean + """ + + """ + clientId: String + """ + + """ + clientSecret: String +} + +input ConfigAuthMethodOauthEntraidUpdateInput { + tenant: String + enabled: Boolean + clientId: String + clientSecret: String +} + +input ConfigAuthMethodOauthEntraidInsertInput { + tenant: String + enabled: Boolean + clientId: String + clientSecret: String +} + +input ConfigAuthMethodOauthEntraidComparisonExp { + _and: [ConfigAuthMethodOauthEntraidComparisonExp!] + _not: ConfigAuthMethodOauthEntraidComparisonExp + _or: [ConfigAuthMethodOauthEntraidComparisonExp!] + tenant: ConfigStringComparisonExp + enabled: ConfigBooleanComparisonExp + clientId: ConfigStringComparisonExp + clientSecret: ConfigStringComparisonExp +} + +""" + """ type ConfigAuthMethodOauthTwitter { """ diff --git a/vendor/github.com/nhost/be/tools/cuegraph/types/int8.go b/vendor/github.com/nhost/be/tools/cuegraph/types/int8.go index 0508023e8..621d0d65b 100644 --- a/vendor/github.com/nhost/be/tools/cuegraph/types/int8.go +++ b/vendor/github.com/nhost/be/tools/cuegraph/types/int8.go @@ -1,4 +1,4 @@ -package types //nolint: dupl +package types //nolint: dupl,revive,nolintlint import ( "encoding/json" diff --git a/vendor/github.com/nhost/be/tools/cuegraph/types/uint16.go b/vendor/github.com/nhost/be/tools/cuegraph/types/uint16.go index bda77d1cb..1838fb7da 100644 --- a/vendor/github.com/nhost/be/tools/cuegraph/types/uint16.go +++ b/vendor/github.com/nhost/be/tools/cuegraph/types/uint16.go @@ -1,4 +1,4 @@ -package types +package types //nolint: revive,nolintlint import ( "encoding/json" diff --git a/vendor/github.com/nhost/be/tools/cuegraph/types/uint8.go b/vendor/github.com/nhost/be/tools/cuegraph/types/uint8.go index 7ebbb4453..c7c11009d 100644 --- a/vendor/github.com/nhost/be/tools/cuegraph/types/uint8.go +++ b/vendor/github.com/nhost/be/tools/cuegraph/types/uint8.go @@ -1,4 +1,4 @@ -package types //nolint:dupl,revive +package types //nolint:dupl,revive,nolintlint import ( "encoding/json" diff --git a/vendor/modules.txt b/vendor/modules.txt index 3b6b1e40c..ed5eecff3 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -662,7 +662,7 @@ github.com/muesli/termenv # github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 ## explicit github.com/munnerz/goautoneg -# github.com/nhost/be v0.0.0-20250730065440-072ba750534a +# github.com/nhost/be v0.0.0-20250826100053-51f349e46355 ## explicit; go 1.24.2 github.com/nhost/be/lib/graphql github.com/nhost/be/lib/graphql/context