Skip to content
Closed
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
14 changes: 9 additions & 5 deletions .github/workflows/pkg-go-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0

- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: ">=1.25.0"
# golangci-lint v1 cannot read export data emitted by Go 1.27 or later,
# so the lint job tracks the newest Go the linter supports rather than
# the newest Go available. Raise this together with the linter version
# in pkg/go/Makefile.
go-version: "1.26"
cache-dependency-path: "./pkg/go/go.sum"
check-latest: true

Expand All @@ -30,7 +34,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Generate Antlr code and validate up to date
run: |
Expand All @@ -43,12 +47,12 @@ jobs:
matrix:
go-version: ["1.25", "1.26"]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0

- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/pkg-java-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ jobs:
testCheckout:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0

lint:
name: Lint Java
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0

- name: Set up JDK
uses: actions/setup-java@0f481fcb613427c0f801b606911222b5b6f3083a # v5.5.0
uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
with:
java-version: 20
distribution: "temurin"
Expand All @@ -42,7 +42,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Generate Antlr code and validate up to date
run: |
Expand All @@ -59,15 +59,15 @@ jobs:
java: ["11", "17", "20"]

steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0

- name: Set up JDK
uses: actions/setup-java@0f481fcb613427c0f801b606911222b5b6f3083a # v5.5.0
uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
with:
java-version: ${{ matrix.java }}
distribution: "temurin"
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/pkg-java-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,24 @@ jobs:
working-directory: "pkg/java"

steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
path: "."
sparse-checkout: "pkg/java"
sparse-checkout-cone-mode: false

- name: Set up JDK
uses: actions/setup-java@0f481fcb613427c0f801b606911222b5b6f3083a # v5.5.0
uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
with:
java-version: 11
distribution: "temurin"

- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0
uses: gradle/actions/wrapper-validation@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0

- name: Setup Gradle
uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0
with:
cache-provider: basic # Use the open-source basic cache provider

Expand All @@ -65,24 +65,24 @@ jobs:
working-directory: "pkg/java"

steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
path: "."
sparse-checkout: "pkg/java"
sparse-checkout-cone-mode: false

- name: Set up JDK
uses: actions/setup-java@0f481fcb613427c0f801b606911222b5b6f3083a # v5.5.0
uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
with:
java-version: 11
distribution: "temurin"

- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0
uses: gradle/actions/wrapper-validation@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0

- name: Setup Gradle
uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0
with:
cache-provider: basic # Use the open-source basic cache provider

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pkg-js-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Set up node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
Expand All @@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Generate Antlr code and validate up to date
run: |
Expand All @@ -45,12 +45,12 @@ jobs:
node-version: [20.x, 22.x, 24.x, 25.x]

steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0

- name: Set up node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pkg-js-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
working-directory: "pkg/js"

steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
path: "."
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable-release-please.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
private-key: ${{ secrets.RELEASER_APP_PRIVATE_KEY }}

- name: Checkout (full history + tags)
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
Expand Down Expand Up @@ -243,7 +243,7 @@ jobs:
private-key: ${{ secrets.RELEASER_APP_PRIVATE_KEY }}

- name: Checkout (full history + tags)
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ jobs:

steps:
- name: "Checkout code"
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
uses: ossf/scorecard-action@2d1146689b8cda280b9bc96326124645441f03bc # v2.4.4
with:
results_file: results.sarif
results_format: sarif
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-release-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Run parse-release tests
run: bash .github/workflows/scripts/parse-release.test.sh

6 changes: 6 additions & 0 deletions OpenFGALexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ STRING:

BYTES: ('b' | 'B') STRING;

// Reserved condition name for inline expressions on a type restriction
// (e.g. `define viewer: [user with $expression]`). It is intentionally placed
// before IDENTIFIER so the literal wins, and `$` exists nowhere else in the
// lexer, so this cannot collide with any existing token.
DOLLAR_EXPRESSION: '$expression';
Comment on lines +132 to +136

IDENTIFIER: (LETTER | '_') (LETTER | DIGIT | '_' | MINUS)*;
// NOTE: MINUS is not allowed in CEL, but allowed in FGA, CEL will be revalidated after

Expand Down
2 changes: 1 addition & 1 deletion OpenFGAParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ relationDefRewrite: rewriteComputedusersetName=extended_identifier (WHITESPACE F

relationDefTypeRestriction: NEWLINE? (
relationDefTypeRestrictionBase
| (relationDefTypeRestrictionBase WHITESPACE KEYWORD_WITH WHITESPACE conditionName)
| (relationDefTypeRestrictionBase WHITESPACE KEYWORD_WITH WHITESPACE (conditionName | DOLLAR_EXPRESSION))
) NEWLINE?;
relationDefTypeRestrictionBase: relationDefTypeRestrictionType=extended_identifier
((COLON relationDefTypeRestrictionWildcard=STAR)
Expand Down
3 changes: 2 additions & 1 deletion pkg/go/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
BINARY_NAME=openfga-language
DOCKER_BINARY=docker
GO_BIN ?= $(shell go env GOPATH)/bin
GOLANGCI_LINT_VERSION ?= v1.64.8
.DEFAULT_GOAL := help

help: ## Show this help
Expand All @@ -12,7 +13,7 @@ help: ## Show this help
#-----------------------------------------------------------------------------------------------------------------------
$(GO_BIN)/golangci-lint:
@echo "==> Installing golangci-lint within "${GO_BIN}""
@go install -v github.com/golangci/golangci-lint/cmd/golangci-lint@latest
@go install -v github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)

$(GO_BIN)/govulncheck:
@echo "==> Installing govulncheck within "${GO_BIN}""
Expand Down
5 changes: 4 additions & 1 deletion pkg/go/gen/OpenFGALexer.interp

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions pkg/go/gen/OpenFGALexer.tokens

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading