Fix various bad tenant isolation
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -1749,7 +1749,6 @@ type ComplexityRoot struct {
|
||||
|
||||
Viewer struct {
|
||||
ID func(childComplexity int) int
|
||||
Invitations func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.InvitationOrder, filter *types.InvitationFilter) int
|
||||
Organizations func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrganizationOrder) int
|
||||
User func(childComplexity int) int
|
||||
}
|
||||
@@ -2172,7 +2171,6 @@ type VendorServiceResolver interface {
|
||||
}
|
||||
type ViewerResolver interface {
|
||||
Organizations(ctx context.Context, obj *types.Viewer, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrganizationOrder) (*types.OrganizationConnection, error)
|
||||
Invitations(ctx context.Context, obj *types.Viewer, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.InvitationOrder, filter *types.InvitationFilter) (*types.InvitationConnection, error)
|
||||
}
|
||||
|
||||
type executableSchema struct {
|
||||
@@ -9422,18 +9420,6 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin
|
||||
|
||||
return e.complexity.Viewer.ID(childComplexity), true
|
||||
|
||||
case "Viewer.invitations":
|
||||
if e.complexity.Viewer.Invitations == nil {
|
||||
break
|
||||
}
|
||||
|
||||
args, err := ec.field_Viewer_invitations_args(ctx, rawArgs)
|
||||
if err != nil {
|
||||
return 0, false
|
||||
}
|
||||
|
||||
return e.complexity.Viewer.Invitations(childComplexity, args["first"].(*int), args["after"].(*page.CursorKey), args["last"].(*int), args["before"].(*page.CursorKey), args["orderBy"].(*types.InvitationOrder), args["filter"].(*types.InvitationFilter)), true
|
||||
|
||||
case "Viewer.organizations":
|
||||
if e.complexity.Viewer.Organizations == nil {
|
||||
break
|
||||
@@ -12142,15 +12128,6 @@ type Viewer {
|
||||
before: CursorKey
|
||||
orderBy: OrganizationOrder
|
||||
): OrganizationConnection! @goField(forceResolver: true)
|
||||
|
||||
invitations(
|
||||
first: Int
|
||||
after: CursorKey
|
||||
last: Int
|
||||
before: CursorKey
|
||||
orderBy: InvitationOrder
|
||||
filter: InvitationFilter
|
||||
): InvitationConnection! @goField(forceResolver: true)
|
||||
}
|
||||
|
||||
# Connection Types
|
||||
@@ -22840,119 +22817,6 @@ func (ec *executionContext) field_Vendor_services_argsOrderBy(
|
||||
return zeroVal, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) field_Viewer_invitations_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
|
||||
var err error
|
||||
args := map[string]any{}
|
||||
arg0, err := ec.field_Viewer_invitations_argsFirst(ctx, rawArgs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
args["first"] = arg0
|
||||
arg1, err := ec.field_Viewer_invitations_argsAfter(ctx, rawArgs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
args["after"] = arg1
|
||||
arg2, err := ec.field_Viewer_invitations_argsLast(ctx, rawArgs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
args["last"] = arg2
|
||||
arg3, err := ec.field_Viewer_invitations_argsBefore(ctx, rawArgs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
args["before"] = arg3
|
||||
arg4, err := ec.field_Viewer_invitations_argsOrderBy(ctx, rawArgs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
args["orderBy"] = arg4
|
||||
arg5, err := ec.field_Viewer_invitations_argsFilter(ctx, rawArgs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
args["filter"] = arg5
|
||||
return args, nil
|
||||
}
|
||||
func (ec *executionContext) field_Viewer_invitations_argsFirst(
|
||||
ctx context.Context,
|
||||
rawArgs map[string]any,
|
||||
) (*int, error) {
|
||||
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first"))
|
||||
if tmp, ok := rawArgs["first"]; ok {
|
||||
return ec.unmarshalOInt2ᚖint(ctx, tmp)
|
||||
}
|
||||
|
||||
var zeroVal *int
|
||||
return zeroVal, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) field_Viewer_invitations_argsAfter(
|
||||
ctx context.Context,
|
||||
rawArgs map[string]any,
|
||||
) (*page.CursorKey, error) {
|
||||
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after"))
|
||||
if tmp, ok := rawArgs["after"]; ok {
|
||||
return ec.unmarshalOCursorKey2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋpageᚐCursorKey(ctx, tmp)
|
||||
}
|
||||
|
||||
var zeroVal *page.CursorKey
|
||||
return zeroVal, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) field_Viewer_invitations_argsLast(
|
||||
ctx context.Context,
|
||||
rawArgs map[string]any,
|
||||
) (*int, error) {
|
||||
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("last"))
|
||||
if tmp, ok := rawArgs["last"]; ok {
|
||||
return ec.unmarshalOInt2ᚖint(ctx, tmp)
|
||||
}
|
||||
|
||||
var zeroVal *int
|
||||
return zeroVal, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) field_Viewer_invitations_argsBefore(
|
||||
ctx context.Context,
|
||||
rawArgs map[string]any,
|
||||
) (*page.CursorKey, error) {
|
||||
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("before"))
|
||||
if tmp, ok := rawArgs["before"]; ok {
|
||||
return ec.unmarshalOCursorKey2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋpageᚐCursorKey(ctx, tmp)
|
||||
}
|
||||
|
||||
var zeroVal *page.CursorKey
|
||||
return zeroVal, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) field_Viewer_invitations_argsOrderBy(
|
||||
ctx context.Context,
|
||||
rawArgs map[string]any,
|
||||
) (*types.InvitationOrder, error) {
|
||||
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy"))
|
||||
if tmp, ok := rawArgs["orderBy"]; ok {
|
||||
return ec.unmarshalOInvitationOrder2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐInvitationOrder(ctx, tmp)
|
||||
}
|
||||
|
||||
var zeroVal *types.InvitationOrder
|
||||
return zeroVal, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) field_Viewer_invitations_argsFilter(
|
||||
ctx context.Context,
|
||||
rawArgs map[string]any,
|
||||
) (*types.InvitationFilter, error) {
|
||||
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter"))
|
||||
if tmp, ok := rawArgs["filter"]; ok {
|
||||
return ec.unmarshalOInvitationFilter2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐInvitationFilter(ctx, tmp)
|
||||
}
|
||||
|
||||
var zeroVal *types.InvitationFilter
|
||||
return zeroVal, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) field_Viewer_organizations_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
|
||||
var err error
|
||||
args := map[string]any{}
|
||||
@@ -54498,8 +54362,6 @@ func (ec *executionContext) fieldContext_Query_viewer(_ context.Context, field g
|
||||
return ec.fieldContext_Viewer_user(ctx, field)
|
||||
case "organizations":
|
||||
return ec.fieldContext_Viewer_organizations(ctx, field)
|
||||
case "invitations":
|
||||
return ec.fieldContext_Viewer_invitations(ctx, field)
|
||||
}
|
||||
return nil, fmt.Errorf("no field named %q was found under type Viewer", field.Name)
|
||||
},
|
||||
@@ -71204,69 +71066,6 @@ func (ec *executionContext) fieldContext_Viewer_organizations(ctx context.Contex
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Viewer_invitations(ctx context.Context, field graphql.CollectedField, obj *types.Viewer) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Viewer_invitations(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 ec.resolvers.Viewer().Invitations(rctx, obj, fc.Args["first"].(*int), fc.Args["after"].(*page.CursorKey), fc.Args["last"].(*int), fc.Args["before"].(*page.CursorKey), fc.Args["orderBy"].(*types.InvitationOrder), fc.Args["filter"].(*types.InvitationFilter))
|
||||
})
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return graphql.Null
|
||||
}
|
||||
if resTmp == nil {
|
||||
if !graphql.HasFieldError(ctx, fc) {
|
||||
ec.Errorf(ctx, "must not be null")
|
||||
}
|
||||
return graphql.Null
|
||||
}
|
||||
res := resTmp.(*types.InvitationConnection)
|
||||
fc.Result = res
|
||||
return ec.marshalNInvitationConnection2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐInvitationConnection(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) fieldContext_Viewer_invitations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||
fc = &graphql.FieldContext{
|
||||
Object: "Viewer",
|
||||
Field: field,
|
||||
IsMethod: true,
|
||||
IsResolver: true,
|
||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||
switch field.Name {
|
||||
case "totalCount":
|
||||
return ec.fieldContext_InvitationConnection_totalCount(ctx, field)
|
||||
case "edges":
|
||||
return ec.fieldContext_InvitationConnection_edges(ctx, field)
|
||||
case "pageInfo":
|
||||
return ec.fieldContext_InvitationConnection_pageInfo(ctx, field)
|
||||
}
|
||||
return nil, fmt.Errorf("no field named %q was found under type InvitationConnection", field.Name)
|
||||
},
|
||||
}
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
err = ec.Recover(ctx, r)
|
||||
ec.Error(ctx, err)
|
||||
}
|
||||
}()
|
||||
ctx = graphql.WithFieldContext(ctx, fc)
|
||||
if fc.Args, err = ec.field_Viewer_invitations_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return fc, err
|
||||
}
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext___Directive_name(ctx, field)
|
||||
if err != nil {
|
||||
@@ -98483,42 +98282,6 @@ func (ec *executionContext) _Viewer(ctx context.Context, sel ast.SelectionSet, o
|
||||
continue
|
||||
}
|
||||
|
||||
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
||||
case "invitations":
|
||||
field := field
|
||||
|
||||
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
}
|
||||
}()
|
||||
res = ec._Viewer_invitations(ctx, field, obj)
|
||||
if res == graphql.Null {
|
||||
atomic.AddUint32(&fs.Invalids, 1)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
if field.Deferrable != nil {
|
||||
dfs, ok := deferred[field.Deferrable.Label]
|
||||
di := 0
|
||||
if ok {
|
||||
dfs.AddField(field)
|
||||
di = len(dfs.Values) - 1
|
||||
} else {
|
||||
dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
|
||||
deferred[field.Deferrable.Label] = dfs
|
||||
}
|
||||
dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
|
||||
return innerFunc(ctx, dfs)
|
||||
})
|
||||
|
||||
// don't run the out.Concurrently() call below
|
||||
out.Values[i] = graphql.Null
|
||||
continue
|
||||
}
|
||||
|
||||
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
||||
default:
|
||||
panic("unknown field " + strconv.Quote(field.Name))
|
||||
|
||||
Reference in New Issue
Block a user