• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ory / keto / 10166504429

30 Jul 2024 04:53PM CUT coverage: 77.612%. First build
10166504429

Pull #1559

github

zepatrik
chore: bump ory/x
Pull Request #1559: chore: bump dependencies

5734 of 7388 relevant lines covered (77.61%)

489.75 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/contrib/docs-code-samples/simple-access-check-guide/01-check-direct-access/main.go
1
// Copyright © 2023 Ory Corp
2
// SPDX-License-Identifier: Apache-2.0
3

4
package main
5

6
import (
7
        "context"
8
        "fmt"
9

10
        rts "github.com/ory/keto/proto/ory/keto/relation_tuples/v1alpha2"
11

12
        "google.golang.org/grpc"
13
        "google.golang.org/grpc/credentials/insecure"
14
)
15

16
func main() {
×
17
        conn, err := grpc.Dial("127.0.0.1:4466", grpc.WithTransportCredentials(insecure.NewCredentials()))
×
18
        if err != nil {
×
19
                panic(err.Error())
×
20
        }
21

22
        client := rts.NewCheckServiceClient(conn)
×
23

×
24
        res, err := client.Check(context.Background(), &rts.CheckRequest{
×
25
                Namespace: "messages",
×
26
                Object:    "02y_15_4w350m3",
×
27
                Relation:  "decypher",
×
28
                Subject:   rts.NewSubjectID("john"),
×
29
        })
×
30
        if err != nil {
×
31
                panic(err.Error())
×
32
        }
33

34
        if res.Allowed {
×
35
                fmt.Println("Allowed")
×
36
                return
×
37
        }
×
38
        fmt.Println("Denied")
×
39
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc