diff --git a/apiclient/types/oauthapp.go b/apiclient/types/oauthapp.go index 3cf7a6958..a61ca05db 100644 --- a/apiclient/types/oauthapp.go +++ b/apiclient/types/oauthapp.go @@ -37,8 +37,8 @@ type OAuthAppManifest struct { OptionalScope string `json:"optionalScope,omitempty"` // This field is required, it correlates to the integration name in the gptscript oauth cred tool Alias string `json:"alias,omitempty"` - // Global indicates if the OAuth app is globally applied to all agents. - Global bool `json:"global,omitempty"` + // Global indicates if the OAuth app is globally applied to all agents. Defaults to false. + Global *bool `json:"global,omitempty"` // This field is only used by Salesforce InstanceURL string `json:"instanceURL,omitempty"` } diff --git a/apiclient/types/zz_generated.deepcopy.go b/apiclient/types/zz_generated.deepcopy.go index c2133c850..2943c3140 100644 --- a/apiclient/types/zz_generated.deepcopy.go +++ b/apiclient/types/zz_generated.deepcopy.go @@ -1200,6 +1200,11 @@ func (in *OAuthAppLoginAuthStatus) DeepCopy() *OAuthAppLoginAuthStatus { func (in *OAuthAppManifest) DeepCopyInto(out *OAuthAppManifest) { *out = *in in.Metadata.DeepCopyInto(&out.Metadata) + if in.Global != nil { + in, out := &in.Global, &out.Global + *out = new(bool) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OAuthAppManifest. diff --git a/pkg/gateway/types/oauth_apps.go b/pkg/gateway/types/oauth_apps.go index 59372332c..53661ed28 100644 --- a/pkg/gateway/types/oauth_apps.go +++ b/pkg/gateway/types/oauth_apps.go @@ -176,7 +176,7 @@ func MergeOAuthAppManifests(r, other types.OAuthAppManifest) types.OAuthAppManif if other.OptionalScope != "" { retVal.OptionalScope = other.OptionalScope } - if other.Global { + if other.Global != nil { retVal.Global = other.Global } diff --git a/pkg/render/render.go b/pkg/render/render.go index 1f702606c..18b6399b2 100644 --- a/pkg/render/render.go +++ b/pkg/render/render.go @@ -162,7 +162,7 @@ func OAuthAppEnv(ctx context.Context, db kclient.Client, oauthAppNames []string, activeIntegrations := map[string]v1.OAuthApp{} for _, name := range slices.Sorted(maps.Keys(apps)) { app := apps[name] - if !app.Spec.Manifest.Global || app.Spec.Manifest.ClientID == "" || app.Spec.Manifest.ClientSecret == "" || app.Spec.Manifest.Alias == "" { + if app.Spec.Manifest.Global == nil || !*app.Spec.Manifest.Global || app.Spec.Manifest.ClientID == "" || app.Spec.Manifest.ClientSecret == "" || app.Spec.Manifest.Alias == "" { continue } activeIntegrations[app.Spec.Manifest.Alias] = app diff --git a/pkg/storage/openapi/generated/openapi_generated.go b/pkg/storage/openapi/generated/openapi_generated.go index 49b425713..896bfd335 100644 --- a/pkg/storage/openapi/generated/openapi_generated.go +++ b/pkg/storage/openapi/generated/openapi_generated.go @@ -2558,7 +2558,7 @@ func schema_obot_platform_obot_apiclient_types_OAuthAppManifest(ref common.Refer }, "global": { SchemaProps: spec.SchemaProps{ - Description: "Global indicates if the OAuth app is globally applied to all agents.", + Description: "Global indicates if the OAuth app is globally applied to all agents. Defaults to false.", Type: []string{"boolean"}, Format: "", },