351 lines
14 KiB
Go
351 lines
14 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||
// versions:
|
||
// protoc-gen-go v1.36.5
|
||
// protoc (unknown)
|
||
// source: conf/v1/kratos_conf_authn.proto
|
||
|
||
package v1
|
||
|
||
import (
|
||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||
_ "google.golang.org/protobuf/types/known/durationpb"
|
||
reflect "reflect"
|
||
sync "sync"
|
||
unsafe "unsafe"
|
||
)
|
||
|
||
const (
|
||
// Verify that this generated code is sufficiently up-to-date.
|
||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||
)
|
||
|
||
// 认证
|
||
type Authentication struct {
|
||
state protoimpl.MessageState `protogen:"open.v1"`
|
||
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
|
||
Jwt *Authentication_Jwt `protobuf:"bytes,2,opt,name=jwt,proto3,oneof" json:"jwt,omitempty"` // JWT 认证
|
||
Oidc *Authentication_OIDC `protobuf:"bytes,3,opt,name=oidc,proto3,oneof" json:"oidc,omitempty"` // OIDC
|
||
PresharedKey *Authentication_PresharedKey `protobuf:"bytes,4,opt,name=preshared_key,json=presharedKey,proto3,oneof" json:"preshared_key,omitempty"` // 预共享密钥
|
||
unknownFields protoimpl.UnknownFields
|
||
sizeCache protoimpl.SizeCache
|
||
}
|
||
|
||
func (x *Authentication) Reset() {
|
||
*x = Authentication{}
|
||
mi := &file_conf_v1_kratos_conf_authn_proto_msgTypes[0]
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
|
||
func (x *Authentication) String() string {
|
||
return protoimpl.X.MessageStringOf(x)
|
||
}
|
||
|
||
func (*Authentication) ProtoMessage() {}
|
||
|
||
func (x *Authentication) ProtoReflect() protoreflect.Message {
|
||
mi := &file_conf_v1_kratos_conf_authn_proto_msgTypes[0]
|
||
if x != nil {
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
if ms.LoadMessageInfo() == nil {
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
return ms
|
||
}
|
||
return mi.MessageOf(x)
|
||
}
|
||
|
||
// Deprecated: Use Authentication.ProtoReflect.Descriptor instead.
|
||
func (*Authentication) Descriptor() ([]byte, []int) {
|
||
return file_conf_v1_kratos_conf_authn_proto_rawDescGZIP(), []int{0}
|
||
}
|
||
|
||
func (x *Authentication) GetType() string {
|
||
if x != nil {
|
||
return x.Type
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *Authentication) GetJwt() *Authentication_Jwt {
|
||
if x != nil {
|
||
return x.Jwt
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (x *Authentication) GetOidc() *Authentication_OIDC {
|
||
if x != nil {
|
||
return x.Oidc
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (x *Authentication) GetPresharedKey() *Authentication_PresharedKey {
|
||
if x != nil {
|
||
return x.PresharedKey
|
||
}
|
||
return nil
|
||
}
|
||
|
||
// JWT
|
||
type Authentication_Jwt struct {
|
||
state protoimpl.MessageState `protogen:"open.v1"`
|
||
Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"` // JWT签名的算法,支持算法:HS256
|
||
Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` // JWT 秘钥
|
||
unknownFields protoimpl.UnknownFields
|
||
sizeCache protoimpl.SizeCache
|
||
}
|
||
|
||
func (x *Authentication_Jwt) Reset() {
|
||
*x = Authentication_Jwt{}
|
||
mi := &file_conf_v1_kratos_conf_authn_proto_msgTypes[1]
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
|
||
func (x *Authentication_Jwt) String() string {
|
||
return protoimpl.X.MessageStringOf(x)
|
||
}
|
||
|
||
func (*Authentication_Jwt) ProtoMessage() {}
|
||
|
||
func (x *Authentication_Jwt) ProtoReflect() protoreflect.Message {
|
||
mi := &file_conf_v1_kratos_conf_authn_proto_msgTypes[1]
|
||
if x != nil {
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
if ms.LoadMessageInfo() == nil {
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
return ms
|
||
}
|
||
return mi.MessageOf(x)
|
||
}
|
||
|
||
// Deprecated: Use Authentication_Jwt.ProtoReflect.Descriptor instead.
|
||
func (*Authentication_Jwt) Descriptor() ([]byte, []int) {
|
||
return file_conf_v1_kratos_conf_authn_proto_rawDescGZIP(), []int{0, 0}
|
||
}
|
||
|
||
func (x *Authentication_Jwt) GetMethod() string {
|
||
if x != nil {
|
||
return x.Method
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *Authentication_Jwt) GetKey() string {
|
||
if x != nil {
|
||
return x.Key
|
||
}
|
||
return ""
|
||
}
|
||
|
||
type Authentication_OIDC struct {
|
||
state protoimpl.MessageState `protogen:"open.v1"`
|
||
IssuerUrl string `protobuf:"bytes,1,opt,name=issuer_url,json=issuerUrl,proto3" json:"issuer_url,omitempty"`
|
||
Audience string `protobuf:"bytes,2,opt,name=audience,proto3" json:"audience,omitempty"`
|
||
Method string `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"` // JWT签名的算法,支持算法:HS256
|
||
unknownFields protoimpl.UnknownFields
|
||
sizeCache protoimpl.SizeCache
|
||
}
|
||
|
||
func (x *Authentication_OIDC) Reset() {
|
||
*x = Authentication_OIDC{}
|
||
mi := &file_conf_v1_kratos_conf_authn_proto_msgTypes[2]
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
|
||
func (x *Authentication_OIDC) String() string {
|
||
return protoimpl.X.MessageStringOf(x)
|
||
}
|
||
|
||
func (*Authentication_OIDC) ProtoMessage() {}
|
||
|
||
func (x *Authentication_OIDC) ProtoReflect() protoreflect.Message {
|
||
mi := &file_conf_v1_kratos_conf_authn_proto_msgTypes[2]
|
||
if x != nil {
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
if ms.LoadMessageInfo() == nil {
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
return ms
|
||
}
|
||
return mi.MessageOf(x)
|
||
}
|
||
|
||
// Deprecated: Use Authentication_OIDC.ProtoReflect.Descriptor instead.
|
||
func (*Authentication_OIDC) Descriptor() ([]byte, []int) {
|
||
return file_conf_v1_kratos_conf_authn_proto_rawDescGZIP(), []int{0, 1}
|
||
}
|
||
|
||
func (x *Authentication_OIDC) GetIssuerUrl() string {
|
||
if x != nil {
|
||
return x.IssuerUrl
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *Authentication_OIDC) GetAudience() string {
|
||
if x != nil {
|
||
return x.Audience
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *Authentication_OIDC) GetMethod() string {
|
||
if x != nil {
|
||
return x.Method
|
||
}
|
||
return ""
|
||
}
|
||
|
||
type Authentication_PresharedKey struct {
|
||
state protoimpl.MessageState `protogen:"open.v1"`
|
||
ValidKeys []string `protobuf:"bytes,1,rep,name=valid_keys,json=validKeys,proto3" json:"valid_keys,omitempty"`
|
||
unknownFields protoimpl.UnknownFields
|
||
sizeCache protoimpl.SizeCache
|
||
}
|
||
|
||
func (x *Authentication_PresharedKey) Reset() {
|
||
*x = Authentication_PresharedKey{}
|
||
mi := &file_conf_v1_kratos_conf_authn_proto_msgTypes[3]
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
|
||
func (x *Authentication_PresharedKey) String() string {
|
||
return protoimpl.X.MessageStringOf(x)
|
||
}
|
||
|
||
func (*Authentication_PresharedKey) ProtoMessage() {}
|
||
|
||
func (x *Authentication_PresharedKey) ProtoReflect() protoreflect.Message {
|
||
mi := &file_conf_v1_kratos_conf_authn_proto_msgTypes[3]
|
||
if x != nil {
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
if ms.LoadMessageInfo() == nil {
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
return ms
|
||
}
|
||
return mi.MessageOf(x)
|
||
}
|
||
|
||
// Deprecated: Use Authentication_PresharedKey.ProtoReflect.Descriptor instead.
|
||
func (*Authentication_PresharedKey) Descriptor() ([]byte, []int) {
|
||
return file_conf_v1_kratos_conf_authn_proto_rawDescGZIP(), []int{0, 2}
|
||
}
|
||
|
||
func (x *Authentication_PresharedKey) GetValidKeys() []string {
|
||
if x != nil {
|
||
return x.ValidKeys
|
||
}
|
||
return nil
|
||
}
|
||
|
||
var File_conf_v1_kratos_conf_authn_proto protoreflect.FileDescriptor
|
||
|
||
var file_conf_v1_kratos_conf_authn_proto_rawDesc = string([]byte{
|
||
0x0a, 0x1f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73,
|
||
0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||
0x6f, 0x12, 0x04, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
|
||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,
|
||
0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb4, 0x03, 0x0a, 0x0e, 0x41, 0x75, 0x74, 0x68,
|
||
0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79,
|
||
0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2f,
|
||
0x0a, 0x03, 0x6a, 0x77, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f,
|
||
0x6e, 0x66, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
|
||
0x6e, 0x2e, 0x4a, 0x77, 0x74, 0x48, 0x00, 0x52, 0x03, 0x6a, 0x77, 0x74, 0x88, 0x01, 0x01, 0x12,
|
||
0x32, 0x0a, 0x04, 0x6f, 0x69, 0x64, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e,
|
||
0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74,
|
||
0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x49, 0x44, 0x43, 0x48, 0x01, 0x52, 0x04, 0x6f, 0x69, 0x64, 0x63,
|
||
0x88, 0x01, 0x01, 0x12, 0x4b, 0x0a, 0x0d, 0x70, 0x72, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64,
|
||
0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x6e,
|
||
0x66, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||
0x2e, 0x50, 0x72, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x48, 0x02, 0x52,
|
||
0x0c, 0x70, 0x72, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x88, 0x01, 0x01,
|
||
0x1a, 0x2f, 0x0a, 0x03, 0x4a, 0x77, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f,
|
||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12,
|
||
0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65,
|
||
0x79, 0x1a, 0x59, 0x0a, 0x04, 0x4f, 0x49, 0x44, 0x43, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x73,
|
||
0x75, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69,
|
||
0x73, 0x73, 0x75, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x75, 0x64, 0x69,
|
||
0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x75, 0x64, 0x69,
|
||
0x65, 0x6e, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03,
|
||
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x1a, 0x2d, 0x0a, 0x0c,
|
||
0x50, 0x72, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a,
|
||
0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09,
|
||
0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4b, 0x65, 0x79, 0x73, 0x42, 0x06, 0x0a, 0x04, 0x5f,
|
||
0x6a, 0x77, 0x74, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6f, 0x69, 0x64, 0x63, 0x42, 0x10, 0x0a, 0x0e,
|
||
0x5f, 0x70, 0x72, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x5f, 0x6b, 0x65, 0x79, 0x42, 0x86,
|
||
0x01, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x42, 0x14, 0x4b, 0x72, 0x61,
|
||
0x74, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x41, 0x75, 0x74, 0x68, 0x6e, 0x50, 0x72, 0x6f, 0x74,
|
||
0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
|
||
0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f,
|
||
0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67,
|
||
0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa,
|
||
0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xca, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xe2, 0x02, 0x10,
|
||
0x43, 0x6f, 0x6e, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
|
||
0xea, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||
})
|
||
|
||
var (
|
||
file_conf_v1_kratos_conf_authn_proto_rawDescOnce sync.Once
|
||
file_conf_v1_kratos_conf_authn_proto_rawDescData []byte
|
||
)
|
||
|
||
func file_conf_v1_kratos_conf_authn_proto_rawDescGZIP() []byte {
|
||
file_conf_v1_kratos_conf_authn_proto_rawDescOnce.Do(func() {
|
||
file_conf_v1_kratos_conf_authn_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_authn_proto_rawDesc), len(file_conf_v1_kratos_conf_authn_proto_rawDesc)))
|
||
})
|
||
return file_conf_v1_kratos_conf_authn_proto_rawDescData
|
||
}
|
||
|
||
var file_conf_v1_kratos_conf_authn_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||
var file_conf_v1_kratos_conf_authn_proto_goTypes = []any{
|
||
(*Authentication)(nil), // 0: conf.Authentication
|
||
(*Authentication_Jwt)(nil), // 1: conf.Authentication.Jwt
|
||
(*Authentication_OIDC)(nil), // 2: conf.Authentication.OIDC
|
||
(*Authentication_PresharedKey)(nil), // 3: conf.Authentication.PresharedKey
|
||
}
|
||
var file_conf_v1_kratos_conf_authn_proto_depIdxs = []int32{
|
||
1, // 0: conf.Authentication.jwt:type_name -> conf.Authentication.Jwt
|
||
2, // 1: conf.Authentication.oidc:type_name -> conf.Authentication.OIDC
|
||
3, // 2: conf.Authentication.preshared_key:type_name -> conf.Authentication.PresharedKey
|
||
3, // [3:3] is the sub-list for method output_type
|
||
3, // [3:3] is the sub-list for method input_type
|
||
3, // [3:3] is the sub-list for extension type_name
|
||
3, // [3:3] is the sub-list for extension extendee
|
||
0, // [0:3] is the sub-list for field type_name
|
||
}
|
||
|
||
func init() { file_conf_v1_kratos_conf_authn_proto_init() }
|
||
func file_conf_v1_kratos_conf_authn_proto_init() {
|
||
if File_conf_v1_kratos_conf_authn_proto != nil {
|
||
return
|
||
}
|
||
file_conf_v1_kratos_conf_authn_proto_msgTypes[0].OneofWrappers = []any{}
|
||
type x struct{}
|
||
out := protoimpl.TypeBuilder{
|
||
File: protoimpl.DescBuilder{
|
||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_authn_proto_rawDesc), len(file_conf_v1_kratos_conf_authn_proto_rawDesc)),
|
||
NumEnums: 0,
|
||
NumMessages: 4,
|
||
NumExtensions: 0,
|
||
NumServices: 0,
|
||
},
|
||
GoTypes: file_conf_v1_kratos_conf_authn_proto_goTypes,
|
||
DependencyIndexes: file_conf_v1_kratos_conf_authn_proto_depIdxs,
|
||
MessageInfos: file_conf_v1_kratos_conf_authn_proto_msgTypes,
|
||
}.Build()
|
||
File_conf_v1_kratos_conf_authn_proto = out.File
|
||
file_conf_v1_kratos_conf_authn_proto_goTypes = nil
|
||
file_conf_v1_kratos_conf_authn_proto_depIdxs = nil
|
||
}
|