auth/service: move all proto files to single dir (#1439)

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2020-03-30 18:23:00 +03:00 committed by GitHub
parent 4db2f5e79d
commit 756b346672
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 162 additions and 173 deletions

View File

@ -1,12 +1,11 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// source: github.com/micro/go-micro/auth/service/proto/accounts/accounts.proto // source: accounts.proto
package go_micro_auth package go_micro_auth
import ( import (
fmt "fmt" fmt "fmt"
proto "github.com/golang/protobuf/proto" proto "github.com/golang/protobuf/proto"
auth "github.com/micro/go-micro/v2/auth/service/proto/auth"
math "math" math "math"
) )
@ -31,7 +30,7 @@ func (m *ListAccountsRequest) Reset() { *m = ListAccountsRequest{} }
func (m *ListAccountsRequest) String() string { return proto.CompactTextString(m) } func (m *ListAccountsRequest) String() string { return proto.CompactTextString(m) }
func (*ListAccountsRequest) ProtoMessage() {} func (*ListAccountsRequest) ProtoMessage() {}
func (*ListAccountsRequest) Descriptor() ([]byte, []int) { func (*ListAccountsRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_25929ace37374fcc, []int{0} return fileDescriptor_e1e7723af4c007b7, []int{0}
} }
func (m *ListAccountsRequest) XXX_Unmarshal(b []byte) error { func (m *ListAccountsRequest) XXX_Unmarshal(b []byte) error {
@ -53,17 +52,17 @@ func (m *ListAccountsRequest) XXX_DiscardUnknown() {
var xxx_messageInfo_ListAccountsRequest proto.InternalMessageInfo var xxx_messageInfo_ListAccountsRequest proto.InternalMessageInfo
type ListAccountsResponse struct { type ListAccountsResponse struct {
Accounts []*auth.Account `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` Accounts []*Account `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
} }
func (m *ListAccountsResponse) Reset() { *m = ListAccountsResponse{} } func (m *ListAccountsResponse) Reset() { *m = ListAccountsResponse{} }
func (m *ListAccountsResponse) String() string { return proto.CompactTextString(m) } func (m *ListAccountsResponse) String() string { return proto.CompactTextString(m) }
func (*ListAccountsResponse) ProtoMessage() {} func (*ListAccountsResponse) ProtoMessage() {}
func (*ListAccountsResponse) Descriptor() ([]byte, []int) { func (*ListAccountsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_25929ace37374fcc, []int{1} return fileDescriptor_e1e7723af4c007b7, []int{1}
} }
func (m *ListAccountsResponse) XXX_Unmarshal(b []byte) error { func (m *ListAccountsResponse) XXX_Unmarshal(b []byte) error {
@ -84,7 +83,7 @@ func (m *ListAccountsResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_ListAccountsResponse proto.InternalMessageInfo var xxx_messageInfo_ListAccountsResponse proto.InternalMessageInfo
func (m *ListAccountsResponse) GetAccounts() []*auth.Account { func (m *ListAccountsResponse) GetAccounts() []*Account {
if m != nil { if m != nil {
return m.Accounts return m.Accounts
} }
@ -97,21 +96,19 @@ func init() {
} }
func init() { func init() {
proto.RegisterFile("github.com/micro/go-micro/auth/service/proto/accounts/accounts.proto", fileDescriptor_25929ace37374fcc) proto.RegisterFile("accounts.proto", fileDescriptor_e1e7723af4c007b7)
} }
var fileDescriptor_25929ace37374fcc = []byte{ var fileDescriptor_e1e7723af4c007b7 = []byte{
// 186 bytes of a gzipped FileDescriptorProto // 147 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x72, 0x49, 0xcf, 0x2c, 0xc9, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4b, 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, 0x19, 0xc5, 0x72, 0x71, 0xc0, 0xcc, 0x11, 0x0a, 0xe4, 0x62, 0x01, 0x99,
0xf9, 0x79, 0xc5, 0xa9, 0x42, 0x46, 0x5c, 0x1c, 0x30, 0xd7, 0x48, 0x30, 0x2a, 0x30, 0x6b, 0x70, 0x2b, 0xa4, 0x84, 0xa6, 0x0b, 0x8b, 0x1b, 0xa4, 0x94, 0xf1, 0xaa, 0x81, 0x38, 0x48, 0x89, 0x21,
0x1b, 0x89, 0xe9, 0xa1, 0x38, 0x47, 0x0f, 0xaa, 0x25, 0x08, 0xae, 0xce, 0x28, 0x96, 0x8b, 0x03, 0x89, 0x0d, 0xec, 0x11, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb4, 0xbb, 0xf1, 0x10, 0xf5,
0x66, 0x8e, 0x50, 0x20, 0x17, 0x0b, 0xc8, 0x5c, 0x21, 0x25, 0x34, 0x5d, 0x58, 0xdc, 0x20, 0xa5, 0x00, 0x00, 0x00,
0x8c, 0x57, 0x0d, 0xc4, 0x41, 0x4a, 0x0c, 0x49, 0x6c, 0x60, 0x8f, 0x18, 0x03, 0x02, 0x00, 0x00,
0xff, 0xff, 0x23, 0x27, 0x81, 0xfe, 0x5d, 0x01, 0x00, 0x00,
} }

View File

@ -1,12 +1,11 @@
// Code generated by protoc-gen-micro. DO NOT EDIT. // Code generated by protoc-gen-micro. DO NOT EDIT.
// source: github.com/micro/go-micro/auth/service/proto/accounts/accounts.proto // source: accounts.proto
package go_micro_auth package go_micro_auth
import ( import (
fmt "fmt" fmt "fmt"
proto "github.com/golang/protobuf/proto" proto "github.com/golang/protobuf/proto"
_ "github.com/micro/go-micro/v2/auth/service/proto/auth"
math "math" math "math"
) )

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package go.micro.auth; package go.micro.auth;
import "github.com/micro/go-micro/auth/service/proto/auth/auth.proto"; import "auth.proto";
service Accounts { service Accounts {
rpc List(ListAccountsRequest) returns (ListAccountsResponse) {}; rpc List(ListAccountsRequest) returns (ListAccountsResponse) {};

View File

@ -1,5 +1,5 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// source: github.com/micro/go-micro/auth/service/proto/auth/auth.proto // source: auth.proto
package go_micro_auth package go_micro_auth
@ -38,7 +38,7 @@ func (m *Token) Reset() { *m = Token{} }
func (m *Token) String() string { return proto.CompactTextString(m) } func (m *Token) String() string { return proto.CompactTextString(m) }
func (*Token) ProtoMessage() {} func (*Token) ProtoMessage() {}
func (*Token) Descriptor() ([]byte, []int) { func (*Token) Descriptor() ([]byte, []int) {
return fileDescriptor_b246cecfa8195ff3, []int{0} return fileDescriptor_8bbd6f3875b0e874, []int{0}
} }
func (m *Token) XXX_Unmarshal(b []byte) error { func (m *Token) XXX_Unmarshal(b []byte) error {
@ -130,7 +130,7 @@ func (m *Account) Reset() { *m = Account{} }
func (m *Account) String() string { return proto.CompactTextString(m) } func (m *Account) String() string { return proto.CompactTextString(m) }
func (*Account) ProtoMessage() {} func (*Account) ProtoMessage() {}
func (*Account) Descriptor() ([]byte, []int) { func (*Account) Descriptor() ([]byte, []int) {
return fileDescriptor_b246cecfa8195ff3, []int{1} return fileDescriptor_8bbd6f3875b0e874, []int{1}
} }
func (m *Account) XXX_Unmarshal(b []byte) error { func (m *Account) XXX_Unmarshal(b []byte) error {
@ -199,7 +199,7 @@ func (m *Resource) Reset() { *m = Resource{} }
func (m *Resource) String() string { return proto.CompactTextString(m) } func (m *Resource) String() string { return proto.CompactTextString(m) }
func (*Resource) ProtoMessage() {} func (*Resource) ProtoMessage() {}
func (*Resource) Descriptor() ([]byte, []int) { func (*Resource) Descriptor() ([]byte, []int) {
return fileDescriptor_b246cecfa8195ff3, []int{2} return fileDescriptor_8bbd6f3875b0e874, []int{2}
} }
func (m *Resource) XXX_Unmarshal(b []byte) error { func (m *Resource) XXX_Unmarshal(b []byte) error {
@ -256,7 +256,7 @@ func (m *GenerateRequest) Reset() { *m = GenerateRequest{} }
func (m *GenerateRequest) String() string { return proto.CompactTextString(m) } func (m *GenerateRequest) String() string { return proto.CompactTextString(m) }
func (*GenerateRequest) ProtoMessage() {} func (*GenerateRequest) ProtoMessage() {}
func (*GenerateRequest) Descriptor() ([]byte, []int) { func (*GenerateRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_b246cecfa8195ff3, []int{3} return fileDescriptor_8bbd6f3875b0e874, []int{3}
} }
func (m *GenerateRequest) XXX_Unmarshal(b []byte) error { func (m *GenerateRequest) XXX_Unmarshal(b []byte) error {
@ -323,7 +323,7 @@ func (m *GenerateResponse) Reset() { *m = GenerateResponse{} }
func (m *GenerateResponse) String() string { return proto.CompactTextString(m) } func (m *GenerateResponse) String() string { return proto.CompactTextString(m) }
func (*GenerateResponse) ProtoMessage() {} func (*GenerateResponse) ProtoMessage() {}
func (*GenerateResponse) Descriptor() ([]byte, []int) { func (*GenerateResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_b246cecfa8195ff3, []int{4} return fileDescriptor_8bbd6f3875b0e874, []int{4}
} }
func (m *GenerateResponse) XXX_Unmarshal(b []byte) error { func (m *GenerateResponse) XXX_Unmarshal(b []byte) error {
@ -363,7 +363,7 @@ func (m *GrantRequest) Reset() { *m = GrantRequest{} }
func (m *GrantRequest) String() string { return proto.CompactTextString(m) } func (m *GrantRequest) String() string { return proto.CompactTextString(m) }
func (*GrantRequest) ProtoMessage() {} func (*GrantRequest) ProtoMessage() {}
func (*GrantRequest) Descriptor() ([]byte, []int) { func (*GrantRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_b246cecfa8195ff3, []int{5} return fileDescriptor_8bbd6f3875b0e874, []int{5}
} }
func (m *GrantRequest) XXX_Unmarshal(b []byte) error { func (m *GrantRequest) XXX_Unmarshal(b []byte) error {
@ -408,7 +408,7 @@ func (m *GrantResponse) Reset() { *m = GrantResponse{} }
func (m *GrantResponse) String() string { return proto.CompactTextString(m) } func (m *GrantResponse) String() string { return proto.CompactTextString(m) }
func (*GrantResponse) ProtoMessage() {} func (*GrantResponse) ProtoMessage() {}
func (*GrantResponse) Descriptor() ([]byte, []int) { func (*GrantResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_b246cecfa8195ff3, []int{6} return fileDescriptor_8bbd6f3875b0e874, []int{6}
} }
func (m *GrantResponse) XXX_Unmarshal(b []byte) error { func (m *GrantResponse) XXX_Unmarshal(b []byte) error {
@ -441,7 +441,7 @@ func (m *RevokeRequest) Reset() { *m = RevokeRequest{} }
func (m *RevokeRequest) String() string { return proto.CompactTextString(m) } func (m *RevokeRequest) String() string { return proto.CompactTextString(m) }
func (*RevokeRequest) ProtoMessage() {} func (*RevokeRequest) ProtoMessage() {}
func (*RevokeRequest) Descriptor() ([]byte, []int) { func (*RevokeRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_b246cecfa8195ff3, []int{7} return fileDescriptor_8bbd6f3875b0e874, []int{7}
} }
func (m *RevokeRequest) XXX_Unmarshal(b []byte) error { func (m *RevokeRequest) XXX_Unmarshal(b []byte) error {
@ -486,7 +486,7 @@ func (m *RevokeResponse) Reset() { *m = RevokeResponse{} }
func (m *RevokeResponse) String() string { return proto.CompactTextString(m) } func (m *RevokeResponse) String() string { return proto.CompactTextString(m) }
func (*RevokeResponse) ProtoMessage() {} func (*RevokeResponse) ProtoMessage() {}
func (*RevokeResponse) Descriptor() ([]byte, []int) { func (*RevokeResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_b246cecfa8195ff3, []int{8} return fileDescriptor_8bbd6f3875b0e874, []int{8}
} }
func (m *RevokeResponse) XXX_Unmarshal(b []byte) error { func (m *RevokeResponse) XXX_Unmarshal(b []byte) error {
@ -518,7 +518,7 @@ func (m *InspectRequest) Reset() { *m = InspectRequest{} }
func (m *InspectRequest) String() string { return proto.CompactTextString(m) } func (m *InspectRequest) String() string { return proto.CompactTextString(m) }
func (*InspectRequest) ProtoMessage() {} func (*InspectRequest) ProtoMessage() {}
func (*InspectRequest) Descriptor() ([]byte, []int) { func (*InspectRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_b246cecfa8195ff3, []int{9} return fileDescriptor_8bbd6f3875b0e874, []int{9}
} }
func (m *InspectRequest) XXX_Unmarshal(b []byte) error { func (m *InspectRequest) XXX_Unmarshal(b []byte) error {
@ -557,7 +557,7 @@ func (m *InspectResponse) Reset() { *m = InspectResponse{} }
func (m *InspectResponse) String() string { return proto.CompactTextString(m) } func (m *InspectResponse) String() string { return proto.CompactTextString(m) }
func (*InspectResponse) ProtoMessage() {} func (*InspectResponse) ProtoMessage() {}
func (*InspectResponse) Descriptor() ([]byte, []int) { func (*InspectResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_b246cecfa8195ff3, []int{10} return fileDescriptor_8bbd6f3875b0e874, []int{10}
} }
func (m *InspectResponse) XXX_Unmarshal(b []byte) error { func (m *InspectResponse) XXX_Unmarshal(b []byte) error {
@ -597,7 +597,7 @@ func (m *RefreshRequest) Reset() { *m = RefreshRequest{} }
func (m *RefreshRequest) String() string { return proto.CompactTextString(m) } func (m *RefreshRequest) String() string { return proto.CompactTextString(m) }
func (*RefreshRequest) ProtoMessage() {} func (*RefreshRequest) ProtoMessage() {}
func (*RefreshRequest) Descriptor() ([]byte, []int) { func (*RefreshRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_b246cecfa8195ff3, []int{11} return fileDescriptor_8bbd6f3875b0e874, []int{11}
} }
func (m *RefreshRequest) XXX_Unmarshal(b []byte) error { func (m *RefreshRequest) XXX_Unmarshal(b []byte) error {
@ -643,7 +643,7 @@ func (m *RefreshResponse) Reset() { *m = RefreshResponse{} }
func (m *RefreshResponse) String() string { return proto.CompactTextString(m) } func (m *RefreshResponse) String() string { return proto.CompactTextString(m) }
func (*RefreshResponse) ProtoMessage() {} func (*RefreshResponse) ProtoMessage() {}
func (*RefreshResponse) Descriptor() ([]byte, []int) { func (*RefreshResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_b246cecfa8195ff3, []int{12} return fileDescriptor_8bbd6f3875b0e874, []int{12}
} }
func (m *RefreshResponse) XXX_Unmarshal(b []byte) error { func (m *RefreshResponse) XXX_Unmarshal(b []byte) error {
@ -691,49 +691,47 @@ func init() {
} }
func init() { func init() {
proto.RegisterFile("github.com/micro/go-micro/auth/service/proto/auth/auth.proto", fileDescriptor_b246cecfa8195ff3) proto.RegisterFile("auth.proto", fileDescriptor_8bbd6f3875b0e874)
} }
var fileDescriptor_b246cecfa8195ff3 = []byte{ var fileDescriptor_8bbd6f3875b0e874 = []byte{
// 630 bytes of a gzipped FileDescriptorProto // 601 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcd, 0x6e, 0xd3, 0x40, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x4d, 0x6f, 0xd3, 0x40,
0x10, 0xae, 0xed, 0xfc, 0xb8, 0x93, 0xa6, 0xa9, 0x56, 0x55, 0xb1, 0x22, 0x28, 0xc1, 0x20, 0x54, 0x10, 0xad, 0xed, 0x7c, 0x38, 0x93, 0x4f, 0xad, 0xaa, 0x60, 0x45, 0x50, 0x82, 0x41, 0x28, 0x42,
0xa1, 0xe2, 0xa0, 0xf4, 0x82, 0xf8, 0x13, 0x15, 0x54, 0xe5, 0x47, 0xe5, 0x60, 0x21, 0xc1, 0x0d, 0x95, 0x85, 0xd2, 0x0b, 0x02, 0x81, 0xa8, 0xa0, 0x2a, 0x1f, 0x2a, 0x07, 0x0b, 0x09, 0x6e, 0xc8,
0xb9, 0xce, 0xd0, 0x98, 0x34, 0x5e, 0xb3, 0x5e, 0x47, 0xe4, 0xc8, 0x0b, 0xf1, 0x66, 0xbc, 0x00, 0x75, 0x06, 0x12, 0xd2, 0x78, 0xcd, 0x7a, 0x5d, 0x91, 0x23, 0x7f, 0x88, 0x7f, 0xc6, 0x1f, 0xe0,
0x27, 0xb4, 0x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d7, 0xc7, 0x21,
0x6f, 0xee, 0x2d, 0xd8, 0x92, 0x7d, 0xb5, 0x62, 0x4c, 0xa9, 0x98, 0x96, 0x8c, 0xe5, 0x82, 0x71, 0x4b, 0x19, 0xff, 0x32, 0xa0, 0x72, 0x9c, 0xf2, 0x29, 0x39, 0x03, 0x5b, 0xbb, 0x83, 0x1c, 0xfc,
0x9f, 0x42, 0xa7, 0x00, 0x53, 0x13, 0xdd, 0x2b, 0x8f, 0xbe, 0xee, 0xe3, 0x90, 0xa7, 0x0c, 0x7e, 0xdd, 0xe1, 0x83, 0xdb, 0x3b, 0xdf, 0x95, 0x9c, 0x7b, 0xe4, 0x0d, 0xd4, 0x95, 0x50, 0xe4, 0x56,
0x1a, 0x50, 0x3b, 0xce, 0xf8, 0x88, 0x9c, 0x81, 0xad, 0xd5, 0x41, 0xf6, 0xff, 0xac, 0xf0, 0xee, 0x29, 0x7b, 0x5d, 0xe8, 0xc1, 0xc1, 0xae, 0xe7, 0x22, 0x96, 0xa2, 0xb8, 0x81, 0xb5, 0xae, 0xe3,
0xcd, 0xb5, 0xcf, 0x15, 0x9d, 0x1b, 0xe4, 0x0d, 0x34, 0x15, 0x51, 0xe4, 0x46, 0x25, 0x7b, 0x91, 0x06, 0x56, 0x49, 0x19, 0x77, 0xef, 0xbc, 0x26, 0xff, 0x9c, 0x8e, 0xfe, 0x04, 0x00, 0x00, 0xff,
0xe8, 0xee, 0xfe, 0xba, 0xc7, 0x65, 0x2c, 0xb5, 0xe2, 0x12, 0xd6, 0x22, 0x8f, 0x4b, 0x58, 0x15, 0xff, 0x9a, 0xf4, 0x9d, 0x85, 0xaa, 0x06, 0x00, 0x00,
0x66, 0xdc, 0x8d, 0xf3, 0x86, 0xfc, 0x73, 0x3a, 0xfa, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xb6, 0x18,
0xd0, 0x5a, 0xdc, 0x06, 0x00, 0x00,
} }

View File

@ -1,5 +1,5 @@
// Code generated by protoc-gen-micro. DO NOT EDIT. // Code generated by protoc-gen-micro. DO NOT EDIT.
// source: github.com/micro/go-micro/auth/service/proto/auth/auth.proto // source: auth.proto
package go_micro_auth package go_micro_auth

View File

@ -1,12 +1,11 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// source: github.com/micro/go-micro/auth/service/proto/rules/rules.proto // source: rules.proto
package go_micro_auth package go_micro_auth
import ( import (
fmt "fmt" fmt "fmt"
proto "github.com/golang/protobuf/proto" proto "github.com/golang/protobuf/proto"
auth "github.com/micro/go-micro/v2/auth/service/proto/auth"
math "math" math "math"
) )
@ -46,24 +45,24 @@ func (x Access) String() string {
} }
func (Access) EnumDescriptor() ([]byte, []int) { func (Access) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_d5bb7c98c32bdd99, []int{0} return fileDescriptor_8e722d3e922f0937, []int{0}
} }
type Rule struct { type Rule struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"`
Resource *auth.Resource `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"` Resource *Resource `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"`
Access Access `protobuf:"varint,4,opt,name=access,proto3,enum=go.micro.auth.Access" json:"access,omitempty"` Access Access `protobuf:"varint,4,opt,name=access,proto3,enum=go.micro.auth.Access" json:"access,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
} }
func (m *Rule) Reset() { *m = Rule{} } func (m *Rule) Reset() { *m = Rule{} }
func (m *Rule) String() string { return proto.CompactTextString(m) } func (m *Rule) String() string { return proto.CompactTextString(m) }
func (*Rule) ProtoMessage() {} func (*Rule) ProtoMessage() {}
func (*Rule) Descriptor() ([]byte, []int) { func (*Rule) Descriptor() ([]byte, []int) {
return fileDescriptor_d5bb7c98c32bdd99, []int{0} return fileDescriptor_8e722d3e922f0937, []int{0}
} }
func (m *Rule) XXX_Unmarshal(b []byte) error { func (m *Rule) XXX_Unmarshal(b []byte) error {
@ -98,7 +97,7 @@ func (m *Rule) GetRole() string {
return "" return ""
} }
func (m *Rule) GetResource() *auth.Resource { func (m *Rule) GetResource() *Resource {
if m != nil { if m != nil {
return m.Resource return m.Resource
} }
@ -113,19 +112,19 @@ func (m *Rule) GetAccess() Access {
} }
type CreateRequest struct { type CreateRequest struct {
Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"`
Resource *auth.Resource `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` Resource *Resource `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"`
Access Access `protobuf:"varint,3,opt,name=access,proto3,enum=go.micro.auth.Access" json:"access,omitempty"` Access Access `protobuf:"varint,3,opt,name=access,proto3,enum=go.micro.auth.Access" json:"access,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
} }
func (m *CreateRequest) Reset() { *m = CreateRequest{} } func (m *CreateRequest) Reset() { *m = CreateRequest{} }
func (m *CreateRequest) String() string { return proto.CompactTextString(m) } func (m *CreateRequest) String() string { return proto.CompactTextString(m) }
func (*CreateRequest) ProtoMessage() {} func (*CreateRequest) ProtoMessage() {}
func (*CreateRequest) Descriptor() ([]byte, []int) { func (*CreateRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_d5bb7c98c32bdd99, []int{1} return fileDescriptor_8e722d3e922f0937, []int{1}
} }
func (m *CreateRequest) XXX_Unmarshal(b []byte) error { func (m *CreateRequest) XXX_Unmarshal(b []byte) error {
@ -153,7 +152,7 @@ func (m *CreateRequest) GetRole() string {
return "" return ""
} }
func (m *CreateRequest) GetResource() *auth.Resource { func (m *CreateRequest) GetResource() *Resource {
if m != nil { if m != nil {
return m.Resource return m.Resource
} }
@ -177,7 +176,7 @@ func (m *CreateResponse) Reset() { *m = CreateResponse{} }
func (m *CreateResponse) String() string { return proto.CompactTextString(m) } func (m *CreateResponse) String() string { return proto.CompactTextString(m) }
func (*CreateResponse) ProtoMessage() {} func (*CreateResponse) ProtoMessage() {}
func (*CreateResponse) Descriptor() ([]byte, []int) { func (*CreateResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_d5bb7c98c32bdd99, []int{2} return fileDescriptor_8e722d3e922f0937, []int{2}
} }
func (m *CreateResponse) XXX_Unmarshal(b []byte) error { func (m *CreateResponse) XXX_Unmarshal(b []byte) error {
@ -199,19 +198,19 @@ func (m *CreateResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_CreateResponse proto.InternalMessageInfo var xxx_messageInfo_CreateResponse proto.InternalMessageInfo
type DeleteRequest struct { type DeleteRequest struct {
Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"`
Resource *auth.Resource `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` Resource *Resource `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"`
Access Access `protobuf:"varint,3,opt,name=access,proto3,enum=go.micro.auth.Access" json:"access,omitempty"` Access Access `protobuf:"varint,3,opt,name=access,proto3,enum=go.micro.auth.Access" json:"access,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
} }
func (m *DeleteRequest) Reset() { *m = DeleteRequest{} } func (m *DeleteRequest) Reset() { *m = DeleteRequest{} }
func (m *DeleteRequest) String() string { return proto.CompactTextString(m) } func (m *DeleteRequest) String() string { return proto.CompactTextString(m) }
func (*DeleteRequest) ProtoMessage() {} func (*DeleteRequest) ProtoMessage() {}
func (*DeleteRequest) Descriptor() ([]byte, []int) { func (*DeleteRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_d5bb7c98c32bdd99, []int{3} return fileDescriptor_8e722d3e922f0937, []int{3}
} }
func (m *DeleteRequest) XXX_Unmarshal(b []byte) error { func (m *DeleteRequest) XXX_Unmarshal(b []byte) error {
@ -239,7 +238,7 @@ func (m *DeleteRequest) GetRole() string {
return "" return ""
} }
func (m *DeleteRequest) GetResource() *auth.Resource { func (m *DeleteRequest) GetResource() *Resource {
if m != nil { if m != nil {
return m.Resource return m.Resource
} }
@ -263,7 +262,7 @@ func (m *DeleteResponse) Reset() { *m = DeleteResponse{} }
func (m *DeleteResponse) String() string { return proto.CompactTextString(m) } func (m *DeleteResponse) String() string { return proto.CompactTextString(m) }
func (*DeleteResponse) ProtoMessage() {} func (*DeleteResponse) ProtoMessage() {}
func (*DeleteResponse) Descriptor() ([]byte, []int) { func (*DeleteResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_d5bb7c98c32bdd99, []int{4} return fileDescriptor_8e722d3e922f0937, []int{4}
} }
func (m *DeleteResponse) XXX_Unmarshal(b []byte) error { func (m *DeleteResponse) XXX_Unmarshal(b []byte) error {
@ -294,7 +293,7 @@ func (m *ListRequest) Reset() { *m = ListRequest{} }
func (m *ListRequest) String() string { return proto.CompactTextString(m) } func (m *ListRequest) String() string { return proto.CompactTextString(m) }
func (*ListRequest) ProtoMessage() {} func (*ListRequest) ProtoMessage() {}
func (*ListRequest) Descriptor() ([]byte, []int) { func (*ListRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_d5bb7c98c32bdd99, []int{5} return fileDescriptor_8e722d3e922f0937, []int{5}
} }
func (m *ListRequest) XXX_Unmarshal(b []byte) error { func (m *ListRequest) XXX_Unmarshal(b []byte) error {
@ -326,7 +325,7 @@ func (m *ListResponse) Reset() { *m = ListResponse{} }
func (m *ListResponse) String() string { return proto.CompactTextString(m) } func (m *ListResponse) String() string { return proto.CompactTextString(m) }
func (*ListResponse) ProtoMessage() {} func (*ListResponse) ProtoMessage() {}
func (*ListResponse) Descriptor() ([]byte, []int) { func (*ListResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_d5bb7c98c32bdd99, []int{6} return fileDescriptor_8e722d3e922f0937, []int{6}
} }
func (m *ListResponse) XXX_Unmarshal(b []byte) error { func (m *ListResponse) XXX_Unmarshal(b []byte) error {
@ -366,33 +365,31 @@ func init() {
} }
func init() { func init() {
proto.RegisterFile("github.com/micro/go-micro/auth/service/proto/rules/rules.proto", fileDescriptor_d5bb7c98c32bdd99) proto.RegisterFile("rules.proto", fileDescriptor_8e722d3e922f0937)
} }
var fileDescriptor_d5bb7c98c32bdd99 = []byte{ var fileDescriptor_8e722d3e922f0937 = []byte{
// 384 bytes of a gzipped FileDescriptorProto // 346 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x93, 0x41, 0x6b, 0xdb, 0x30, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x93, 0xc1, 0x4e, 0xb3, 0x40,
0x1c, 0xc5, 0x23, 0xc7, 0xf1, 0xb6, 0xbf, 0x97, 0x60, 0x34, 0xc6, 0x8c, 0xb7, 0x81, 0xc9, 0xc9, 0x14, 0x85, 0x3b, 0x94, 0xf2, 0xff, 0x5e, 0x6c, 0x43, 0xae, 0x31, 0x12, 0xd4, 0x84, 0x74, 0x85,
0x1b, 0xc4, 0x06, 0xe7, 0x34, 0x18, 0x83, 0x30, 0x87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 0x3a, 0xad, 0xd5, 0xbf, 0x11, 0xd4, 0xea, 0xa4, 0x83, 0x63, 0x30, 0xab, 0x1a, 0xd0, 0x6b, 0x19, 0xbf,
0x03, 0x4b, 0x37, 0x46, 0xbf, 0xb4, 0xf2, 0x0f, 0xde, 0xa8, 0xf7, 0xf5, 0x84, 0xda, 0x5c, 0xa5, 0x54, 0xe5, 0x1d, 0x7e, 0xab, 0x2d, 0x23, 0x1e, 0xac, 0xfa, 0xa0, 0x8c, 0x3e, 0x03, 0x00, 0x00,
0x53, 0x07, 0xe9, 0xeb, 0x1d, 0x05, 0x1d, 0xd4, 0x7f, 0x14, 0xd4, 0xea, 0xa4, 0x43, 0x27, 0x60, 0xff, 0xff, 0xb8, 0x06, 0xc3, 0x53, 0x52, 0x03, 0x00, 0x00,
0xd6, 0x35, 0x50, 0xaf, 0x65, 0x7c, 0x52, 0x95, 0xf7, 0xf9, 0x59, 0x6d, 0x17, 0xb1, 0xb0, 0xd4,
0x8f, 0x32, 0x7e, 0x0c, 0x00, 0x00, 0xff, 0xff, 0x85, 0x65, 0x07, 0x9d, 0xb7, 0x03, 0x00, 0x00,
} }

View File

@ -1,12 +1,11 @@
// Code generated by protoc-gen-micro. DO NOT EDIT. // Code generated by protoc-gen-micro. DO NOT EDIT.
// source: github.com/micro/go-micro/auth/service/proto/rules/rules.proto // source: rules.proto
package go_micro_auth package go_micro_auth
import ( import (
fmt "fmt" fmt "fmt"
proto "github.com/golang/protobuf/proto" proto "github.com/golang/protobuf/proto"
_ "github.com/micro/go-micro/v2/auth/service/proto/auth"
math "math" math "math"
) )

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package go.micro.auth; package go.micro.auth;
import "github.com/micro/go-micro/auth/service/proto/auth/auth.proto"; import "auth.proto";
service Rules { service Rules {
rpc Create(CreateRequest) returns (CreateResponse) {}; rpc Create(CreateRequest) returns (CreateResponse) {};

View File

@ -8,8 +8,7 @@ import (
"time" "time"
"github.com/micro/go-micro/v2/auth" "github.com/micro/go-micro/v2/auth"
authPb "github.com/micro/go-micro/v2/auth/service/proto/auth" pb "github.com/micro/go-micro/v2/auth/service/proto"
rulePb "github.com/micro/go-micro/v2/auth/service/proto/rules"
"github.com/micro/go-micro/v2/auth/token" "github.com/micro/go-micro/v2/auth/token"
"github.com/micro/go-micro/v2/auth/token/jwt" "github.com/micro/go-micro/v2/auth/token/jwt"
"github.com/micro/go-micro/v2/client" "github.com/micro/go-micro/v2/client"
@ -27,11 +26,11 @@ func NewAuth(opts ...auth.Option) auth.Auth {
// svc is the service implementation of the Auth interface // svc is the service implementation of the Auth interface
type svc struct { type svc struct {
options auth.Options options auth.Options
auth authPb.AuthService auth pb.AuthService
rule rulePb.RulesService rule pb.RulesService
jwt token.Provider jwt token.Provider
rules []*rulePb.Rule rules []*pb.Rule
sync.Mutex sync.Mutex
} }
@ -45,8 +44,8 @@ func (s *svc) Init(opts ...auth.Option) {
} }
dc := client.DefaultClient dc := client.DefaultClient
s.auth = authPb.NewAuthService("go.micro.auth", dc) s.auth = pb.NewAuthService("go.micro.auth", dc)
s.rule = rulePb.NewRulesService("go.micro.auth", dc) s.rule = pb.NewRulesService("go.micro.auth", dc)
// if we have a JWT public key passed as an option, // if we have a JWT public key passed as an option,
// we can decode tokens with the type "JWT" locally // we can decode tokens with the type "JWT" locally
@ -81,7 +80,7 @@ func (s *svc) Options() auth.Options {
func (s *svc) Generate(id string, opts ...auth.GenerateOption) (*auth.Account, error) { func (s *svc) Generate(id string, opts ...auth.GenerateOption) (*auth.Account, error) {
options := auth.NewGenerateOptions(opts...) options := auth.NewGenerateOptions(opts...)
rsp, err := s.auth.Generate(context.TODO(), &authPb.GenerateRequest{ rsp, err := s.auth.Generate(context.TODO(), &pb.GenerateRequest{
Id: id, Id: id,
Roles: options.Roles, Roles: options.Roles,
Metadata: options.Metadata, Metadata: options.Metadata,
@ -97,10 +96,10 @@ func (s *svc) Generate(id string, opts ...auth.GenerateOption) (*auth.Account, e
// Grant access to a resource // Grant access to a resource
func (s *svc) Grant(role string, res *auth.Resource) error { func (s *svc) Grant(role string, res *auth.Resource) error {
_, err := s.rule.Create(context.TODO(), &rulePb.CreateRequest{ _, err := s.rule.Create(context.TODO(), &pb.CreateRequest{
Role: role, Role: role,
Access: rulePb.Access_GRANTED, Access: pb.Access_GRANTED,
Resource: &authPb.Resource{ Resource: &pb.Resource{
Type: res.Type, Type: res.Type,
Name: res.Name, Name: res.Name,
Endpoint: res.Endpoint, Endpoint: res.Endpoint,
@ -111,10 +110,10 @@ func (s *svc) Grant(role string, res *auth.Resource) error {
// Revoke access to a resource // Revoke access to a resource
func (s *svc) Revoke(role string, res *auth.Resource) error { func (s *svc) Revoke(role string, res *auth.Resource) error {
_, err := s.rule.Delete(context.TODO(), &rulePb.DeleteRequest{ _, err := s.rule.Delete(context.TODO(), &pb.DeleteRequest{
Role: role, Role: role,
Access: rulePb.Access_GRANTED, Access: pb.Access_GRANTED,
Resource: &authPb.Resource{ Resource: &pb.Resource{
Type: res.Type, Type: res.Type,
Name: res.Name, Name: res.Name,
Endpoint: res.Endpoint, Endpoint: res.Endpoint,
@ -144,12 +143,12 @@ func (s *svc) Verify(acc *auth.Account, res *auth.Resource) error {
for _, q := range queries { for _, q := range queries {
for _, rule := range s.listRules(q...) { for _, rule := range s.listRules(q...) {
switch accessForRule(rule, acc, res) { switch accessForRule(rule, acc, res) {
case rulePb.Access_UNKNOWN: case pb.Access_UNKNOWN:
continue // rule did not specify access, check the next rule continue // rule did not specify access, check the next rule
case rulePb.Access_GRANTED: case pb.Access_GRANTED:
log.Infof("%v granted access to %v:%v:%v by rule %v", acc.ID, res.Type, res.Name, res.Endpoint, rule.Id) log.Infof("%v granted access to %v:%v:%v by rule %v", acc.ID, res.Type, res.Name, res.Endpoint, rule.Id)
return nil // rule grants the account access to the resource return nil // rule grants the account access to the resource
case rulePb.Access_DENIED: case pb.Access_DENIED:
log.Infof("%v denied access to %v:%v:%v by rule %v", acc.ID, res.Type, res.Name, res.Endpoint, rule.Id) log.Infof("%v denied access to %v:%v:%v by rule %v", acc.ID, res.Type, res.Name, res.Endpoint, rule.Id)
return auth.ErrForbidden // rule denies access to the resource return auth.ErrForbidden // rule denies access to the resource
} }
@ -177,7 +176,7 @@ func (s *svc) Inspect(token string) (*auth.Account, error) {
} }
} }
rsp, err := s.auth.Inspect(context.TODO(), &authPb.InspectRequest{ rsp, err := s.auth.Inspect(context.TODO(), &pb.InspectRequest{
Token: token, Token: token,
}) })
if err != nil { if err != nil {
@ -191,7 +190,7 @@ func (s *svc) Inspect(token string) (*auth.Account, error) {
func (s *svc) Refresh(secret string, opts ...auth.RefreshOption) (*auth.Token, error) { func (s *svc) Refresh(secret string, opts ...auth.RefreshOption) (*auth.Token, error) {
options := auth.NewRefreshOptions(opts...) options := auth.NewRefreshOptions(opts...)
rsp, err := s.auth.Refresh(context.Background(), &authPb.RefreshRequest{ rsp, err := s.auth.Refresh(context.Background(), &pb.RefreshRequest{
Secret: secret, Secret: secret,
TokenExpiry: int64(options.TokenExpiry.Seconds()), TokenExpiry: int64(options.TokenExpiry.Seconds()),
}) })
@ -206,7 +205,7 @@ var ruleJoinKey = ":"
// accessForRule returns a rule status, indicating if a rule permits access to a // accessForRule returns a rule status, indicating if a rule permits access to a
// resource for a given account // resource for a given account
func accessForRule(rule *rulePb.Rule, acc *auth.Account, res *auth.Resource) rulePb.Access { func accessForRule(rule *pb.Rule, acc *auth.Account, res *auth.Resource) pb.Access {
if rule.Role == "*" { if rule.Role == "*" {
return rule.Access return rule.Access
} }
@ -222,18 +221,18 @@ func accessForRule(rule *rulePb.Rule, acc *auth.Account, res *auth.Resource) rul
} }
} }
return rulePb.Access_UNKNOWN return pb.Access_UNKNOWN
} }
// listRules gets all the rules from the store which have an id // listRules gets all the rules from the store which have an id
// prefix matching the filters // prefix matching the filters
func (s *svc) listRules(filters ...string) []*rulePb.Rule { func (s *svc) listRules(filters ...string) []*pb.Rule {
s.Lock() s.Lock()
defer s.Unlock() defer s.Unlock()
prefix := strings.Join(filters, ruleJoinKey) prefix := strings.Join(filters, ruleJoinKey)
var rules []*rulePb.Rule var rules []*pb.Rule
for _, r := range s.rules { for _, r := range s.rules {
if strings.HasPrefix(r.Id, prefix) { if strings.HasPrefix(r.Id, prefix) {
rules = append(rules, r) rules = append(rules, r)
@ -245,7 +244,7 @@ func (s *svc) listRules(filters ...string) []*rulePb.Rule {
// loadRules retrieves the rules from the auth service // loadRules retrieves the rules from the auth service
func (s *svc) loadRules() { func (s *svc) loadRules() {
rsp, err := s.rule.List(context.TODO(), &rulePb.ListRequest{}) rsp, err := s.rule.List(context.TODO(), &pb.ListRequest{})
s.Lock() s.Lock()
defer s.Unlock() defer s.Unlock()
@ -257,7 +256,7 @@ func (s *svc) loadRules() {
s.rules = rsp.Rules s.rules = rsp.Rules
} }
func serializeToken(t *authPb.Token) *auth.Token { func serializeToken(t *pb.Token) *auth.Token {
return &auth.Token{ return &auth.Token{
Token: t.Token, Token: t.Token,
Type: t.Type, Type: t.Type,
@ -269,7 +268,7 @@ func serializeToken(t *authPb.Token) *auth.Token {
} }
} }
func serializeAccount(a *authPb.Account) *auth.Account { func serializeAccount(a *pb.Account) *auth.Account {
var secret *auth.Token var secret *auth.Token
if a.Secret != nil { if a.Secret != nil {
secret = serializeToken(a.Secret) secret = serializeToken(a.Secret)