Add nda signature middleware

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-02-20 19:17:11 +04:00
parent bb8d477495
commit 9da8cc2e3d
12 changed files with 191 additions and 41 deletions

View File

@@ -66,6 +66,20 @@ func AssumptionRequiredf(ctx context.Context, format string, a ...any) *gqlerror
return AssumptionRequired(ctx, fmt.Errorf(format, a...))
}
func NDASignatureRequired(ctx context.Context, err error) *gqlerror.Error {
return &gqlerror.Error{
Message: err.Error(),
Path: graphql.GetPath(ctx),
Extensions: map[string]any{
"code": "NDA_SIGNATURE_REQUIRED",
},
}
}
func NDASignatureRequiredf(ctx context.Context, format string, a ...any) *gqlerror.Error {
return NDASignatureRequired(ctx, fmt.Errorf(format, a...))
}
func Forbidden(ctx context.Context, err error) *gqlerror.Error {
return &gqlerror.Error{
Message: err.Error(),