Skip to content
Merged

Next #596

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: "Nightly Release"
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch: # This allows manual triggering
permissions:
contents: write
packages: write
Expand Down
2 changes: 1 addition & 1 deletion pkg/attribute/attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func Attribute(attribute string) (*base.Attribute, error) {
wrapped = wrapperspb.Double(doubleVal)
// In case of integer
case "integer":
intVal, err := strconv.Atoi(v[1])
intVal, err := strconv.ParseInt(v[1], 10, 32)
if err != nil {
return nil, fmt.Errorf("failed to parse integer: %v", err)
}
Expand Down
13 changes: 13 additions & 0 deletions pkg/attribute/attribute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ var _ = Describe("attribute", func() {
Context("Attribute", func() {
isPublic, _ := anypb.New(wrapperspb.Bool(true))
double, _ := anypb.New(wrapperspb.Double(100))
integer, _ := anypb.New(wrapperspb.Int32(45))

It("ToString", func() {
tests := []struct {
Expand Down Expand Up @@ -88,6 +89,18 @@ var _ = Describe("attribute", func() {
Value: double,
},
},
{
target: "user:1#age@integer:45",
attribute: &base.Attribute{
Entity: &base.Entity{
Type: "user",
Id: "1",
},
Attribute: "age",
Type: "integer",
Value: integer,
},
},
}

for _, tt := range tests {
Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ func validate() func(cmd *cobra.Command, args []string) error {
Metadata: &base.PermissionLookupSubjectRequestMetadata{
SchemaVersion: version,
SnapToken: token.NewNoopToken().Encode().String(),
Depth: 100,
},
SubjectReference: subjectReference,
Permission: permission,
Expand Down