diff --git a/.github/workflows/go-test.yaml b/.github/workflows/go-test.yaml index 06606b7..abaa3e4 100644 --- a/.github/workflows/go-test.yaml +++ b/.github/workflows/go-test.yaml @@ -11,11 +11,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v4 with: - go-version: 1.20 + go-version: '1.20' - name: Install latest nightly Rust uses: actions-rs/toolchain@v1 with: diff --git a/.github/workflows/rust-test.yaml b/.github/workflows/rust-test.yaml index 78770e3..3baae52 100644 --- a/.github/workflows/rust-test.yaml +++ b/.github/workflows/rust-test.yaml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install latest nightly Rust uses: actions-rs/toolchain@v1 with: diff --git a/examples/authorization_request/go.mod b/examples/authorization_request/go.mod deleted file mode 100644 index 909c6f1..0000000 --- a/examples/authorization_request/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module auth-request - -go 1.20 diff --git a/examples/authorization_request/main.go b/examples/authorization_request/main.go deleted file mode 100644 index 648587b..0000000 --- a/examples/authorization_request/main.go +++ /dev/null @@ -1,43 +0,0 @@ -package main - -import ( - "context" - "fmt" - "github.com/Joffref/cedar" -) - -const policies = ` -permit( - principal == User::"alice", - action == Action::"update", - resource == Photo::"VacationPhoto94.jpg" -); -` - -const entities = `[]` - -func main() { - engine, err := cedar.NewCedarEngine(context.Background()) - if err != nil { - panic(err) - } - defer engine.Close(context.Background()) - err = engine.SetEntitiesFromJson(context.Background(), entities) - if err != nil { - panic(err) - } - err = engine.SetPoliciesFromJson(context.Background(), policies) - if err != nil { - panic(err) - } - res, err := engine.Eval(context.Background(), cedar.EvalRequest{ - Principal: "User::\"alice\"", - Action: "Action::\"update\"", - Resource: "Photo::\"VacationPhoto94.jpg\"", - Context: "{}", - }) - if err != nil { - panic(err) - } - fmt.Println(res) -}