Skip to content

Commit 5ff938c

Browse files
authored
openfga: initial integration (google#14295)
Adds initial integration of Openfga. Openfga is an authorization/permission engine that has been used in production by [Auth0 FGA](https://auth0.com/fine-grained-authorization) since December 2021. cc @adriantam for info Signed-off-by: Adam Korczynski <[email protected]>
1 parent 7527ff1 commit 5ff938c

File tree

3 files changed

+83
-0
lines changed

3 files changed

+83
-0
lines changed

projects/openfga/Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
################################################################################
16+
17+
FROM gcr.io/oss-fuzz-base/base-builder-go
18+
RUN git clone --depth 1 https://github.com/openfga/openfga
19+
RUN git clone --depth 1 https://github.com/AdamKorcz/cncf-fuzzing --branch=openfga
20+
RUN git clone --depth 1 https://github.com/AdamKorcz/go-118-fuzz-build --branch=v2_2
21+
COPY build.sh $SRC/
22+
WORKDIR $SRC/openfga

projects/openfga/build.sh

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash -eu
2+
# Copyright 2025 Google LLC.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
################################################################################
17+
18+
cd /tmp
19+
export GOROOT=/root/.go
20+
wget https://go.dev/dl/go1.25.3.linux-amd64.tar.gz
21+
22+
mkdir temp-go
23+
tar -C temp-go/ -xzf go1.25.3.linux-amd64.tar.gz
24+
25+
rm -r /root/.go
26+
mkdir /root/.go/
27+
mv temp-go/go/* /root/.go/
28+
rm -rf temp-go
29+
30+
31+
cd $SRC/go-118-fuzz-build
32+
go build
33+
mv go-118-fuzz-build $GOPATH/bin/go-118-fuzz-build_v2
34+
pushd cmd/convertLibFuzzerTestcaseToStdLibGo
35+
go build . && mv convertLibFuzzerTestcaseToStdLibGo $GOPATH/bin/
36+
popd
37+
pushd cmd/addStdLibCorpusToFuzzer
38+
go build . && mv addStdLibCorpusToFuzzer $GOPATH/bin/
39+
popd
40+
cd $SRC/openfga
41+
42+
43+
cp $SRC/cncf-fuzzing/projects/openfga/authorization_models_advanced_fuzz_test.go $SRC/openfga/tests/
44+
45+
compile_native_go_fuzzer_v2 github.com/openfga/openfga/tests FuzzCheckWithExclusion FuzzCheckWithExclusion
46+
compile_native_go_fuzzer_v2 github.com/openfga/openfga/tests FuzzCheckWithIntersection FuzzCheckWithIntersection
47+
compile_native_go_fuzzer_v2 github.com/openfga/openfga/tests FuzzCheckWithComputedUserset FuzzCheckWithComputedUserset
48+
compile_native_go_fuzzer_v2 github.com/openfga/openfga/tests FuzzCheckWithPublicAccess FuzzCheckWithPublicAccess
49+
compile_native_go_fuzzer_v2 github.com/openfga/openfga/tests FuzzCheckWithMultipleRestrictions FuzzCheckWithMultipleRestrictions
50+
compile_native_go_fuzzer_v2 github.com/openfga/openfga/tests FuzzCheckWithConditions FuzzCheckWithConditions
51+
compile_native_go_fuzzer_v2 github.com/openfga/openfga/tests FuzzCheckWithParentChild FuzzCheckWithParentChild

projects/openfga/project.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
homepage: "https://openfga.dev"
2+
language: go
3+
primary_contact: "[email protected]"
4+
auto_ccs:
5+
6+
main_repo: "https://github.com/openfga/openfga"
7+
fuzzing_engines:
8+
- libfuzzer
9+
sanitizers:
10+
- address

0 commit comments

Comments
 (0)