Run go fmt/fix

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2026-03-13 14:16:00 +01:00
parent 8657761293
commit d5c62a9383
44 changed files with 319 additions and 364 deletions

View File

@@ -17,6 +17,7 @@ package policy
import (
"errors"
"fmt"
"maps"
"go.probo.inc/probo/pkg/gid"
)
@@ -108,9 +109,7 @@ func (a *Authorizer) Authorize(params AuthorizeParams) error {
}
// Add resource attributes to context
for k, v := range params.ResourceAttributes {
conditionCtx.Resource[k] = v
}
maps.Copy(conditionCtx.Resource, params.ResourceAttributes)
// Build authorization request
req := AuthorizationRequest{

View File

@@ -148,7 +148,7 @@ func (c Condition) Evaluate(ctx ConditionContext) bool {
// Support a comma-separated "set" value, e.g.
// principal.organization_ids = "org_1,org_2"
if strings.Contains(resolved, ",") {
for _, item := range strings.Split(resolved, ",") {
for item := range strings.SplitSeq(resolved, ",") {
if value == strings.TrimSpace(item) {
return true
}
@@ -170,7 +170,7 @@ func (c Condition) Evaluate(ctx ConditionContext) bool {
}
if strings.Contains(resolved, ",") {
for _, item := range strings.Split(resolved, ",") {
for item := range strings.SplitSeq(resolved, ",") {
if value == strings.TrimSpace(item) {
return false
}