zitadel/internal/protoc/protoc-gen-authoption
Florian Forster fa9f581d56
chore(v2): move to new org (#3499)
* chore: move to new org

* logging

* fix: org rename caos -> zitadel

Co-authored-by: adlerhurst <silvan.reusser@gmail.com>
2022-04-26 23:01:45 +00:00
..
authoption chore(v2): move to new org (#3499) 2022-04-26 23:01:45 +00:00
templates chore(v2): move to new org (#3499) 2022-04-26 23:01:45 +00:00
generate.go feat: protos refactoring 2021-03-09 10:30:11 +01:00
main.go chore(v2): move to new org (#3499) 2022-04-26 23:01:45 +00:00
README.md chore(v2): move to new org (#3499) 2022-04-26 23:01:45 +00:00

protoc-gen-authoption

Proto options to annotate auth methods in protos

Generate protos/templates

protos: go generate authoption/generate.go
templates/install: go generate generate.go

Usage

// proto file
import "authoption/options.proto";

service MyService {

    rpc Hello(Hello) returns (google.protobuf.Empty) {
        option (google.api.http) = {
        get: "/hello"
        };

        option (caos.zitadel.utils.v1.auth_option) = {
            zitadel_permission: "hello.read"
            zitadel_check_param: "id"
        };
    }

    message Hello {
        string id = 1;
    }
}

Caos Auth Option is used for granting groups On each zitadel role is specified which auth methods are allowed to call

Get protoc-get-authoption: go get github.com/zitadel/zitadel/internal/protoc/protoc-gen-authoption

Protc-Flag: --authoption_out=.