Compare commits
4 Commits
0d2cd5fb49
...
8b06a1414d
Author | SHA1 | Date | |
---|---|---|---|
8b06a1414d | |||
79c21b62d8 | |||
032f0e8739 | |||
251a24efae |
@ -61,6 +61,7 @@ paths:
|
|||||||
operationId: sessionValidate
|
operationId: sessionValidate
|
||||||
tags:
|
tags:
|
||||||
- Session
|
- Session
|
||||||
|
security: []
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: Successful response
|
description: Successful response
|
||||||
@ -80,6 +81,7 @@ paths:
|
|||||||
operationId: listSubmissions
|
operationId: listSubmissions
|
||||||
tags:
|
tags:
|
||||||
- Submissions
|
- Submissions
|
||||||
|
security: []
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: "#/components/parameters/Page"
|
- $ref: "#/components/parameters/Page"
|
||||||
- $ref: "#/components/parameters/Limit"
|
- $ref: "#/components/parameters/Limit"
|
||||||
@ -148,6 +150,7 @@ paths:
|
|||||||
operationId: getSubmission
|
operationId: getSubmission
|
||||||
tags:
|
tags:
|
||||||
- Submissions
|
- Submissions
|
||||||
|
security: []
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: '#/components/parameters/SubmissionID'
|
- $ref: '#/components/parameters/SubmissionID'
|
||||||
responses:
|
responses:
|
||||||
@ -376,6 +379,7 @@ paths:
|
|||||||
operationId: listScriptPolicy
|
operationId: listScriptPolicy
|
||||||
tags:
|
tags:
|
||||||
- ScriptPolicy
|
- ScriptPolicy
|
||||||
|
security: []
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: "#/components/parameters/Page"
|
- $ref: "#/components/parameters/Page"
|
||||||
- $ref: "#/components/parameters/Limit"
|
- $ref: "#/components/parameters/Limit"
|
||||||
@ -440,6 +444,7 @@ paths:
|
|||||||
operationId: getScriptPolicy
|
operationId: getScriptPolicy
|
||||||
tags:
|
tags:
|
||||||
- ScriptPolicy
|
- ScriptPolicy
|
||||||
|
security: []
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: '#/components/parameters/ScriptPolicyID'
|
- $ref: '#/components/parameters/ScriptPolicyID'
|
||||||
responses:
|
responses:
|
||||||
@ -499,6 +504,7 @@ paths:
|
|||||||
operationId: listScripts
|
operationId: listScripts
|
||||||
tags:
|
tags:
|
||||||
- Script
|
- Script
|
||||||
|
security: []
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: "#/components/parameters/Page"
|
- $ref: "#/components/parameters/Page"
|
||||||
- $ref: "#/components/parameters/Limit"
|
- $ref: "#/components/parameters/Limit"
|
||||||
@ -568,6 +574,7 @@ paths:
|
|||||||
operationId: getScript
|
operationId: getScript
|
||||||
tags:
|
tags:
|
||||||
- Scripts
|
- Scripts
|
||||||
|
security: []
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: '#/components/parameters/ScriptID'
|
- $ref: '#/components/parameters/ScriptID'
|
||||||
responses:
|
responses:
|
||||||
|
@ -1878,39 +1878,6 @@ func (c *Client) sendGetScript(ctx context.Context, params GetScriptParams) (res
|
|||||||
return res, errors.Wrap(err, "create request")
|
return res, errors.Wrap(err, "create request")
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
type bitset = [1]uint8
|
|
||||||
var satisfied bitset
|
|
||||||
{
|
|
||||||
stage = "Security:CookieAuth"
|
|
||||||
switch err := c.securityCookieAuth(ctx, GetScriptOperation, r); {
|
|
||||||
case err == nil: // if NO error
|
|
||||||
satisfied[0] |= 1 << 0
|
|
||||||
case errors.Is(err, ogenerrors.ErrSkipClientSecurity):
|
|
||||||
// Skip this security.
|
|
||||||
default:
|
|
||||||
return res, errors.Wrap(err, "security \"CookieAuth\"")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ok := func() bool {
|
|
||||||
nextRequirement:
|
|
||||||
for _, requirement := range []bitset{
|
|
||||||
{0b00000001},
|
|
||||||
} {
|
|
||||||
for i, mask := range requirement {
|
|
||||||
if satisfied[i]&mask != mask {
|
|
||||||
continue nextRequirement
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}(); !ok {
|
|
||||||
return res, ogenerrors.ErrSecurityRequirementIsNotSatisfied
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage = "SendRequest"
|
stage = "SendRequest"
|
||||||
resp, err := c.cfg.Client.Do(r)
|
resp, err := c.cfg.Client.Do(r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -2001,39 +1968,6 @@ func (c *Client) sendGetScriptPolicy(ctx context.Context, params GetScriptPolicy
|
|||||||
return res, errors.Wrap(err, "create request")
|
return res, errors.Wrap(err, "create request")
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
type bitset = [1]uint8
|
|
||||||
var satisfied bitset
|
|
||||||
{
|
|
||||||
stage = "Security:CookieAuth"
|
|
||||||
switch err := c.securityCookieAuth(ctx, GetScriptPolicyOperation, r); {
|
|
||||||
case err == nil: // if NO error
|
|
||||||
satisfied[0] |= 1 << 0
|
|
||||||
case errors.Is(err, ogenerrors.ErrSkipClientSecurity):
|
|
||||||
// Skip this security.
|
|
||||||
default:
|
|
||||||
return res, errors.Wrap(err, "security \"CookieAuth\"")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ok := func() bool {
|
|
||||||
nextRequirement:
|
|
||||||
for _, requirement := range []bitset{
|
|
||||||
{0b00000001},
|
|
||||||
} {
|
|
||||||
for i, mask := range requirement {
|
|
||||||
if satisfied[i]&mask != mask {
|
|
||||||
continue nextRequirement
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}(); !ok {
|
|
||||||
return res, ogenerrors.ErrSecurityRequirementIsNotSatisfied
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage = "SendRequest"
|
stage = "SendRequest"
|
||||||
resp, err := c.cfg.Client.Do(r)
|
resp, err := c.cfg.Client.Do(r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -2124,39 +2058,6 @@ func (c *Client) sendGetSubmission(ctx context.Context, params GetSubmissionPara
|
|||||||
return res, errors.Wrap(err, "create request")
|
return res, errors.Wrap(err, "create request")
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
type bitset = [1]uint8
|
|
||||||
var satisfied bitset
|
|
||||||
{
|
|
||||||
stage = "Security:CookieAuth"
|
|
||||||
switch err := c.securityCookieAuth(ctx, GetSubmissionOperation, r); {
|
|
||||||
case err == nil: // if NO error
|
|
||||||
satisfied[0] |= 1 << 0
|
|
||||||
case errors.Is(err, ogenerrors.ErrSkipClientSecurity):
|
|
||||||
// Skip this security.
|
|
||||||
default:
|
|
||||||
return res, errors.Wrap(err, "security \"CookieAuth\"")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ok := func() bool {
|
|
||||||
nextRequirement:
|
|
||||||
for _, requirement := range []bitset{
|
|
||||||
{0b00000001},
|
|
||||||
} {
|
|
||||||
for i, mask := range requirement {
|
|
||||||
if satisfied[i]&mask != mask {
|
|
||||||
continue nextRequirement
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}(); !ok {
|
|
||||||
return res, ogenerrors.ErrSecurityRequirementIsNotSatisfied
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage = "SendRequest"
|
stage = "SendRequest"
|
||||||
resp, err := c.cfg.Client.Do(r)
|
resp, err := c.cfg.Client.Do(r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -2312,39 +2213,6 @@ func (c *Client) sendListScriptPolicy(ctx context.Context, params ListScriptPoli
|
|||||||
return res, errors.Wrap(err, "create request")
|
return res, errors.Wrap(err, "create request")
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
type bitset = [1]uint8
|
|
||||||
var satisfied bitset
|
|
||||||
{
|
|
||||||
stage = "Security:CookieAuth"
|
|
||||||
switch err := c.securityCookieAuth(ctx, ListScriptPolicyOperation, r); {
|
|
||||||
case err == nil: // if NO error
|
|
||||||
satisfied[0] |= 1 << 0
|
|
||||||
case errors.Is(err, ogenerrors.ErrSkipClientSecurity):
|
|
||||||
// Skip this security.
|
|
||||||
default:
|
|
||||||
return res, errors.Wrap(err, "security \"CookieAuth\"")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ok := func() bool {
|
|
||||||
nextRequirement:
|
|
||||||
for _, requirement := range []bitset{
|
|
||||||
{0b00000001},
|
|
||||||
} {
|
|
||||||
for i, mask := range requirement {
|
|
||||||
if satisfied[i]&mask != mask {
|
|
||||||
continue nextRequirement
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}(); !ok {
|
|
||||||
return res, ogenerrors.ErrSecurityRequirementIsNotSatisfied
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage = "SendRequest"
|
stage = "SendRequest"
|
||||||
resp, err := c.cfg.Client.Do(r)
|
resp, err := c.cfg.Client.Do(r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -2517,39 +2385,6 @@ func (c *Client) sendListScripts(ctx context.Context, params ListScriptsParams)
|
|||||||
return res, errors.Wrap(err, "create request")
|
return res, errors.Wrap(err, "create request")
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
type bitset = [1]uint8
|
|
||||||
var satisfied bitset
|
|
||||||
{
|
|
||||||
stage = "Security:CookieAuth"
|
|
||||||
switch err := c.securityCookieAuth(ctx, ListScriptsOperation, r); {
|
|
||||||
case err == nil: // if NO error
|
|
||||||
satisfied[0] |= 1 << 0
|
|
||||||
case errors.Is(err, ogenerrors.ErrSkipClientSecurity):
|
|
||||||
// Skip this security.
|
|
||||||
default:
|
|
||||||
return res, errors.Wrap(err, "security \"CookieAuth\"")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ok := func() bool {
|
|
||||||
nextRequirement:
|
|
||||||
for _, requirement := range []bitset{
|
|
||||||
{0b00000001},
|
|
||||||
} {
|
|
||||||
for i, mask := range requirement {
|
|
||||||
if satisfied[i]&mask != mask {
|
|
||||||
continue nextRequirement
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}(); !ok {
|
|
||||||
return res, ogenerrors.ErrSecurityRequirementIsNotSatisfied
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage = "SendRequest"
|
stage = "SendRequest"
|
||||||
resp, err := c.cfg.Client.Do(r)
|
resp, err := c.cfg.Client.Do(r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -2722,39 +2557,6 @@ func (c *Client) sendListSubmissions(ctx context.Context, params ListSubmissions
|
|||||||
return res, errors.Wrap(err, "create request")
|
return res, errors.Wrap(err, "create request")
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
type bitset = [1]uint8
|
|
||||||
var satisfied bitset
|
|
||||||
{
|
|
||||||
stage = "Security:CookieAuth"
|
|
||||||
switch err := c.securityCookieAuth(ctx, ListSubmissionsOperation, r); {
|
|
||||||
case err == nil: // if NO error
|
|
||||||
satisfied[0] |= 1 << 0
|
|
||||||
case errors.Is(err, ogenerrors.ErrSkipClientSecurity):
|
|
||||||
// Skip this security.
|
|
||||||
default:
|
|
||||||
return res, errors.Wrap(err, "security \"CookieAuth\"")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ok := func() bool {
|
|
||||||
nextRequirement:
|
|
||||||
for _, requirement := range []bitset{
|
|
||||||
{0b00000001},
|
|
||||||
} {
|
|
||||||
for i, mask := range requirement {
|
|
||||||
if satisfied[i]&mask != mask {
|
|
||||||
continue nextRequirement
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}(); !ok {
|
|
||||||
return res, ogenerrors.ErrSecurityRequirementIsNotSatisfied
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage = "SendRequest"
|
stage = "SendRequest"
|
||||||
resp, err := c.cfg.Client.Do(r)
|
resp, err := c.cfg.Client.Do(r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -3145,39 +2947,6 @@ func (c *Client) sendSessionValidate(ctx context.Context) (res bool, err error)
|
|||||||
return res, errors.Wrap(err, "create request")
|
return res, errors.Wrap(err, "create request")
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
type bitset = [1]uint8
|
|
||||||
var satisfied bitset
|
|
||||||
{
|
|
||||||
stage = "Security:CookieAuth"
|
|
||||||
switch err := c.securityCookieAuth(ctx, SessionValidateOperation, r); {
|
|
||||||
case err == nil: // if NO error
|
|
||||||
satisfied[0] |= 1 << 0
|
|
||||||
case errors.Is(err, ogenerrors.ErrSkipClientSecurity):
|
|
||||||
// Skip this security.
|
|
||||||
default:
|
|
||||||
return res, errors.Wrap(err, "security \"CookieAuth\"")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ok := func() bool {
|
|
||||||
nextRequirement:
|
|
||||||
for _, requirement := range []bitset{
|
|
||||||
{0b00000001},
|
|
||||||
} {
|
|
||||||
for i, mask := range requirement {
|
|
||||||
if satisfied[i]&mask != mask {
|
|
||||||
continue nextRequirement
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}(); !ok {
|
|
||||||
return res, ogenerrors.ErrSecurityRequirementIsNotSatisfied
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage = "SendRequest"
|
stage = "SendRequest"
|
||||||
resp, err := c.cfg.Client.Do(r)
|
resp, err := c.cfg.Client.Do(r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -2639,52 +2639,6 @@ func (s *Server) handleGetScriptRequest(args [1]string, argsEscaped bool, w http
|
|||||||
ID: "getScript",
|
ID: "getScript",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
{
|
|
||||||
type bitset = [1]uint8
|
|
||||||
var satisfied bitset
|
|
||||||
{
|
|
||||||
sctx, ok, err := s.securityCookieAuth(ctx, GetScriptOperation, r)
|
|
||||||
if err != nil {
|
|
||||||
err = &ogenerrors.SecurityError{
|
|
||||||
OperationContext: opErrContext,
|
|
||||||
Security: "CookieAuth",
|
|
||||||
Err: err,
|
|
||||||
}
|
|
||||||
if encodeErr := encodeErrorResponse(s.h.NewError(ctx, err), w, span); encodeErr != nil {
|
|
||||||
defer recordError("Security:CookieAuth", err)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if ok {
|
|
||||||
satisfied[0] |= 1 << 0
|
|
||||||
ctx = sctx
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ok := func() bool {
|
|
||||||
nextRequirement:
|
|
||||||
for _, requirement := range []bitset{
|
|
||||||
{0b00000001},
|
|
||||||
} {
|
|
||||||
for i, mask := range requirement {
|
|
||||||
if satisfied[i]&mask != mask {
|
|
||||||
continue nextRequirement
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}(); !ok {
|
|
||||||
err = &ogenerrors.SecurityError{
|
|
||||||
OperationContext: opErrContext,
|
|
||||||
Err: ogenerrors.ErrSecurityRequirementIsNotSatisfied,
|
|
||||||
}
|
|
||||||
if encodeErr := encodeErrorResponse(s.h.NewError(ctx, err), w, span); encodeErr != nil {
|
|
||||||
defer recordError("Security", err)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
params, err := decodeGetScriptParams(args, argsEscaped, r)
|
params, err := decodeGetScriptParams(args, argsEscaped, r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = &ogenerrors.DecodeParamsError{
|
err = &ogenerrors.DecodeParamsError{
|
||||||
@ -2834,52 +2788,6 @@ func (s *Server) handleGetScriptPolicyRequest(args [1]string, argsEscaped bool,
|
|||||||
ID: "getScriptPolicy",
|
ID: "getScriptPolicy",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
{
|
|
||||||
type bitset = [1]uint8
|
|
||||||
var satisfied bitset
|
|
||||||
{
|
|
||||||
sctx, ok, err := s.securityCookieAuth(ctx, GetScriptPolicyOperation, r)
|
|
||||||
if err != nil {
|
|
||||||
err = &ogenerrors.SecurityError{
|
|
||||||
OperationContext: opErrContext,
|
|
||||||
Security: "CookieAuth",
|
|
||||||
Err: err,
|
|
||||||
}
|
|
||||||
if encodeErr := encodeErrorResponse(s.h.NewError(ctx, err), w, span); encodeErr != nil {
|
|
||||||
defer recordError("Security:CookieAuth", err)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if ok {
|
|
||||||
satisfied[0] |= 1 << 0
|
|
||||||
ctx = sctx
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ok := func() bool {
|
|
||||||
nextRequirement:
|
|
||||||
for _, requirement := range []bitset{
|
|
||||||
{0b00000001},
|
|
||||||
} {
|
|
||||||
for i, mask := range requirement {
|
|
||||||
if satisfied[i]&mask != mask {
|
|
||||||
continue nextRequirement
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}(); !ok {
|
|
||||||
err = &ogenerrors.SecurityError{
|
|
||||||
OperationContext: opErrContext,
|
|
||||||
Err: ogenerrors.ErrSecurityRequirementIsNotSatisfied,
|
|
||||||
}
|
|
||||||
if encodeErr := encodeErrorResponse(s.h.NewError(ctx, err), w, span); encodeErr != nil {
|
|
||||||
defer recordError("Security", err)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
params, err := decodeGetScriptPolicyParams(args, argsEscaped, r)
|
params, err := decodeGetScriptPolicyParams(args, argsEscaped, r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = &ogenerrors.DecodeParamsError{
|
err = &ogenerrors.DecodeParamsError{
|
||||||
@ -3029,52 +2937,6 @@ func (s *Server) handleGetSubmissionRequest(args [1]string, argsEscaped bool, w
|
|||||||
ID: "getSubmission",
|
ID: "getSubmission",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
{
|
|
||||||
type bitset = [1]uint8
|
|
||||||
var satisfied bitset
|
|
||||||
{
|
|
||||||
sctx, ok, err := s.securityCookieAuth(ctx, GetSubmissionOperation, r)
|
|
||||||
if err != nil {
|
|
||||||
err = &ogenerrors.SecurityError{
|
|
||||||
OperationContext: opErrContext,
|
|
||||||
Security: "CookieAuth",
|
|
||||||
Err: err,
|
|
||||||
}
|
|
||||||
if encodeErr := encodeErrorResponse(s.h.NewError(ctx, err), w, span); encodeErr != nil {
|
|
||||||
defer recordError("Security:CookieAuth", err)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if ok {
|
|
||||||
satisfied[0] |= 1 << 0
|
|
||||||
ctx = sctx
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ok := func() bool {
|
|
||||||
nextRequirement:
|
|
||||||
for _, requirement := range []bitset{
|
|
||||||
{0b00000001},
|
|
||||||
} {
|
|
||||||
for i, mask := range requirement {
|
|
||||||
if satisfied[i]&mask != mask {
|
|
||||||
continue nextRequirement
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}(); !ok {
|
|
||||||
err = &ogenerrors.SecurityError{
|
|
||||||
OperationContext: opErrContext,
|
|
||||||
Err: ogenerrors.ErrSecurityRequirementIsNotSatisfied,
|
|
||||||
}
|
|
||||||
if encodeErr := encodeErrorResponse(s.h.NewError(ctx, err), w, span); encodeErr != nil {
|
|
||||||
defer recordError("Security", err)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
params, err := decodeGetSubmissionParams(args, argsEscaped, r)
|
params, err := decodeGetSubmissionParams(args, argsEscaped, r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = &ogenerrors.DecodeParamsError{
|
err = &ogenerrors.DecodeParamsError{
|
||||||
@ -3224,52 +3086,6 @@ func (s *Server) handleListScriptPolicyRequest(args [0]string, argsEscaped bool,
|
|||||||
ID: "listScriptPolicy",
|
ID: "listScriptPolicy",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
{
|
|
||||||
type bitset = [1]uint8
|
|
||||||
var satisfied bitset
|
|
||||||
{
|
|
||||||
sctx, ok, err := s.securityCookieAuth(ctx, ListScriptPolicyOperation, r)
|
|
||||||
if err != nil {
|
|
||||||
err = &ogenerrors.SecurityError{
|
|
||||||
OperationContext: opErrContext,
|
|
||||||
Security: "CookieAuth",
|
|
||||||
Err: err,
|
|
||||||
}
|
|
||||||
if encodeErr := encodeErrorResponse(s.h.NewError(ctx, err), w, span); encodeErr != nil {
|
|
||||||
defer recordError("Security:CookieAuth", err)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if ok {
|
|
||||||
satisfied[0] |= 1 << 0
|
|
||||||
ctx = sctx
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ok := func() bool {
|
|
||||||
nextRequirement:
|
|
||||||
for _, requirement := range []bitset{
|
|
||||||
{0b00000001},
|
|
||||||
} {
|
|
||||||
for i, mask := range requirement {
|
|
||||||
if satisfied[i]&mask != mask {
|
|
||||||
continue nextRequirement
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}(); !ok {
|
|
||||||
err = &ogenerrors.SecurityError{
|
|
||||||
OperationContext: opErrContext,
|
|
||||||
Err: ogenerrors.ErrSecurityRequirementIsNotSatisfied,
|
|
||||||
}
|
|
||||||
if encodeErr := encodeErrorResponse(s.h.NewError(ctx, err), w, span); encodeErr != nil {
|
|
||||||
defer recordError("Security", err)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
params, err := decodeListScriptPolicyParams(args, argsEscaped, r)
|
params, err := decodeListScriptPolicyParams(args, argsEscaped, r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = &ogenerrors.DecodeParamsError{
|
err = &ogenerrors.DecodeParamsError{
|
||||||
@ -3435,52 +3251,6 @@ func (s *Server) handleListScriptsRequest(args [0]string, argsEscaped bool, w ht
|
|||||||
ID: "listScripts",
|
ID: "listScripts",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
{
|
|
||||||
type bitset = [1]uint8
|
|
||||||
var satisfied bitset
|
|
||||||
{
|
|
||||||
sctx, ok, err := s.securityCookieAuth(ctx, ListScriptsOperation, r)
|
|
||||||
if err != nil {
|
|
||||||
err = &ogenerrors.SecurityError{
|
|
||||||
OperationContext: opErrContext,
|
|
||||||
Security: "CookieAuth",
|
|
||||||
Err: err,
|
|
||||||
}
|
|
||||||
if encodeErr := encodeErrorResponse(s.h.NewError(ctx, err), w, span); encodeErr != nil {
|
|
||||||
defer recordError("Security:CookieAuth", err)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if ok {
|
|
||||||
satisfied[0] |= 1 << 0
|
|
||||||
ctx = sctx
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ok := func() bool {
|
|
||||||
nextRequirement:
|
|
||||||
for _, requirement := range []bitset{
|
|
||||||
{0b00000001},
|
|
||||||
} {
|
|
||||||
for i, mask := range requirement {
|
|
||||||
if satisfied[i]&mask != mask {
|
|
||||||
continue nextRequirement
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}(); !ok {
|
|
||||||
err = &ogenerrors.SecurityError{
|
|
||||||
OperationContext: opErrContext,
|
|
||||||
Err: ogenerrors.ErrSecurityRequirementIsNotSatisfied,
|
|
||||||
}
|
|
||||||
if encodeErr := encodeErrorResponse(s.h.NewError(ctx, err), w, span); encodeErr != nil {
|
|
||||||
defer recordError("Security", err)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
params, err := decodeListScriptsParams(args, argsEscaped, r)
|
params, err := decodeListScriptsParams(args, argsEscaped, r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = &ogenerrors.DecodeParamsError{
|
err = &ogenerrors.DecodeParamsError{
|
||||||
@ -3650,52 +3420,6 @@ func (s *Server) handleListSubmissionsRequest(args [0]string, argsEscaped bool,
|
|||||||
ID: "listSubmissions",
|
ID: "listSubmissions",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
{
|
|
||||||
type bitset = [1]uint8
|
|
||||||
var satisfied bitset
|
|
||||||
{
|
|
||||||
sctx, ok, err := s.securityCookieAuth(ctx, ListSubmissionsOperation, r)
|
|
||||||
if err != nil {
|
|
||||||
err = &ogenerrors.SecurityError{
|
|
||||||
OperationContext: opErrContext,
|
|
||||||
Security: "CookieAuth",
|
|
||||||
Err: err,
|
|
||||||
}
|
|
||||||
if encodeErr := encodeErrorResponse(s.h.NewError(ctx, err), w, span); encodeErr != nil {
|
|
||||||
defer recordError("Security:CookieAuth", err)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if ok {
|
|
||||||
satisfied[0] |= 1 << 0
|
|
||||||
ctx = sctx
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ok := func() bool {
|
|
||||||
nextRequirement:
|
|
||||||
for _, requirement := range []bitset{
|
|
||||||
{0b00000001},
|
|
||||||
} {
|
|
||||||
for i, mask := range requirement {
|
|
||||||
if satisfied[i]&mask != mask {
|
|
||||||
continue nextRequirement
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}(); !ok {
|
|
||||||
err = &ogenerrors.SecurityError{
|
|
||||||
OperationContext: opErrContext,
|
|
||||||
Err: ogenerrors.ErrSecurityRequirementIsNotSatisfied,
|
|
||||||
}
|
|
||||||
if encodeErr := encodeErrorResponse(s.h.NewError(ctx, err), w, span); encodeErr != nil {
|
|
||||||
defer recordError("Security", err)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
params, err := decodeListSubmissionsParams(args, argsEscaped, r)
|
params, err := decodeListSubmissionsParams(args, argsEscaped, r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = &ogenerrors.DecodeParamsError{
|
err = &ogenerrors.DecodeParamsError{
|
||||||
@ -4414,58 +4138,8 @@ func (s *Server) handleSessionValidateRequest(args [0]string, argsEscaped bool,
|
|||||||
|
|
||||||
s.errors.Add(ctx, 1, metric.WithAttributes(attrs...))
|
s.errors.Add(ctx, 1, metric.WithAttributes(attrs...))
|
||||||
}
|
}
|
||||||
err error
|
err error
|
||||||
opErrContext = ogenerrors.OperationContext{
|
|
||||||
Name: SessionValidateOperation,
|
|
||||||
ID: "sessionValidate",
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
{
|
|
||||||
type bitset = [1]uint8
|
|
||||||
var satisfied bitset
|
|
||||||
{
|
|
||||||
sctx, ok, err := s.securityCookieAuth(ctx, SessionValidateOperation, r)
|
|
||||||
if err != nil {
|
|
||||||
err = &ogenerrors.SecurityError{
|
|
||||||
OperationContext: opErrContext,
|
|
||||||
Security: "CookieAuth",
|
|
||||||
Err: err,
|
|
||||||
}
|
|
||||||
if encodeErr := encodeErrorResponse(s.h.NewError(ctx, err), w, span); encodeErr != nil {
|
|
||||||
defer recordError("Security:CookieAuth", err)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if ok {
|
|
||||||
satisfied[0] |= 1 << 0
|
|
||||||
ctx = sctx
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ok := func() bool {
|
|
||||||
nextRequirement:
|
|
||||||
for _, requirement := range []bitset{
|
|
||||||
{0b00000001},
|
|
||||||
} {
|
|
||||||
for i, mask := range requirement {
|
|
||||||
if satisfied[i]&mask != mask {
|
|
||||||
continue nextRequirement
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}(); !ok {
|
|
||||||
err = &ogenerrors.SecurityError{
|
|
||||||
OperationContext: opErrContext,
|
|
||||||
Err: ogenerrors.ErrSecurityRequirementIsNotSatisfied,
|
|
||||||
}
|
|
||||||
if encodeErr := encodeErrorResponse(s.h.NewError(ctx, err), w, span); encodeErr != nil {
|
|
||||||
defer recordError("Security", err)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var response bool
|
var response bool
|
||||||
if m := s.cfg.Middleware; m != nil {
|
if m := s.cfg.Middleware; m != nil {
|
||||||
|
@ -30,4 +30,4 @@ export default function Webpage({children}: Readonly<{children?: React.ReactNode
|
|||||||
<Header/>
|
<Header/>
|
||||||
{children}
|
{children}
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user