From 16c5d13e101d142279d121469ec6872e9b61f8ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Thu, 7 May 2020 18:43:06 +0200 Subject: [PATCH] Update accounts API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- changelog/unreleased/update-accounts-api.md | 5 + pkg/account/accounts.go | 11 +- pkg/proto/v0/accounts.pb.go | 1347 +++++++------------ pkg/proto/v0/accounts.proto | 7 +- pkg/service/v0/service.go | 66 +- pkg/store/filesystem/store.go | 105 +- 6 files changed, 679 insertions(+), 862 deletions(-) create mode 100644 changelog/unreleased/update-accounts-api.md diff --git a/changelog/unreleased/update-accounts-api.md b/changelog/unreleased/update-accounts-api.md new file mode 100644 index 000000000..55993cf88 --- /dev/null +++ b/changelog/unreleased/update-accounts-api.md @@ -0,0 +1,5 @@ +Enhancement: Update accounts API + +We updated the api to allow fetching users not onyl by UUID, but also by identity (OpenID issuer and subject) email, username and optionally a password. + +https://github.com/owncloud/ocis-accounts/pull/30 diff --git a/pkg/account/accounts.go b/pkg/account/accounts.go index 19df2cf85..5c453d8f7 100644 --- a/pkg/account/accounts.go +++ b/pkg/account/accounts.go @@ -17,9 +17,16 @@ var ( type RegisterFunc func(*config.Config) Manager // Manager is an accounts service interface +// TODO email and username might not be unique? type Manager interface { - // Read a record - Read(key string) (*proto.Record, error) + // Read a record by uuid + Read(uuid string) (*proto.Record, error) + // Read a record by username + ReadByUsername(username string) (*proto.Record, error) + // Read a record by email + ReadByEmail(email string) (*proto.Record, error) + // Read a record by identity (iss & sub) + ReadByIdentity(identity *proto.IdHistory) (*proto.Record, error) // Write a record Write(*proto.Record) (*proto.Record, error) // List all records diff --git a/pkg/proto/v0/accounts.pb.go b/pkg/proto/v0/accounts.pb.go index 52f5a82a4..e9e298b6b 100644 --- a/pkg/proto/v0/accounts.pb.go +++ b/pkg/proto/v0/accounts.pb.go @@ -1,591 +1,534 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.21.0 -// protoc v3.11.4 // source: accounts.proto package proto import ( + fmt "fmt" proto "github.com/golang/protobuf/proto" _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" + math "math" ) -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) -) +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type Record struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Payload *Payload `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Payload *Payload `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *Record) Reset() { - *x = Record{} - if protoimpl.UnsafeEnabled { - mi := &file_accounts_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Record) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Record) ProtoMessage() {} - -func (x *Record) ProtoReflect() protoreflect.Message { - mi := &file_accounts_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Record.ProtoReflect.Descriptor instead. +func (m *Record) Reset() { *m = Record{} } +func (m *Record) String() string { return proto.CompactTextString(m) } +func (*Record) ProtoMessage() {} func (*Record) Descriptor() ([]byte, []int) { - return file_accounts_proto_rawDescGZIP(), []int{0} + return fileDescriptor_e1e7723af4c007b7, []int{0} } -func (x *Record) GetKey() string { - if x != nil { - return x.Key +func (m *Record) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Record.Unmarshal(m, b) +} +func (m *Record) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Record.Marshal(b, m, deterministic) +} +func (m *Record) XXX_Merge(src proto.Message) { + xxx_messageInfo_Record.Merge(m, src) +} +func (m *Record) XXX_Size() int { + return xxx_messageInfo_Record.Size(m) +} +func (m *Record) XXX_DiscardUnknown() { + xxx_messageInfo_Record.DiscardUnknown(m) +} + +var xxx_messageInfo_Record proto.InternalMessageInfo + +func (m *Record) GetKey() string { + if m != nil { + return m.Key } return "" } -func (x *Record) GetPayload() *Payload { - if x != nil { - return x.Payload +func (m *Record) GetPayload() *Payload { + if m != nil { + return m.Payload } return nil } type Payload struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Account *Account `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` + Account *Account `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *Payload) Reset() { - *x = Payload{} - if protoimpl.UnsafeEnabled { - mi := &file_accounts_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Payload) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Payload) ProtoMessage() {} - -func (x *Payload) ProtoReflect() protoreflect.Message { - mi := &file_accounts_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Payload.ProtoReflect.Descriptor instead. +func (m *Payload) Reset() { *m = Payload{} } +func (m *Payload) String() string { return proto.CompactTextString(m) } +func (*Payload) ProtoMessage() {} func (*Payload) Descriptor() ([]byte, []int) { - return file_accounts_proto_rawDescGZIP(), []int{1} + return fileDescriptor_e1e7723af4c007b7, []int{1} } -func (x *Payload) GetAccount() *Account { - if x != nil { - return x.Account +func (m *Payload) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Payload.Unmarshal(m, b) +} +func (m *Payload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Payload.Marshal(b, m, deterministic) +} +func (m *Payload) XXX_Merge(src proto.Message) { + xxx_messageInfo_Payload.Merge(m, src) +} +func (m *Payload) XXX_Size() int { + return xxx_messageInfo_Payload.Size(m) +} +func (m *Payload) XXX_DiscardUnknown() { + xxx_messageInfo_Payload.DiscardUnknown(m) +} + +var xxx_messageInfo_Payload proto.InternalMessageInfo + +func (m *Payload) GetAccount() *Account { + if m != nil { + return m.Account } return nil } type Account struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` - StandardClaims *StandardClaims `protobuf:"bytes,2,opt,name=standard_claims,json=standardClaims,proto3" json:"standard_claims,omitempty"` - Identities []*IdHistory `protobuf:"bytes,3,rep,name=identities,proto3" json:"identities,omitempty"` // keep track of every identity of a given user + StandardClaims *StandardClaims `protobuf:"bytes,1,opt,name=standard_claims,json=standardClaims,proto3" json:"standard_claims,omitempty"` + Identities []*IdHistory `protobuf:"bytes,2,rep,name=identities,proto3" json:"identities,omitempty"` + Issuer string `protobuf:"bytes,3,opt,name=Issuer,proto3" json:"Issuer,omitempty"` + Password string `protobuf:"bytes,4,opt,name=Password,proto3" json:"Password,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *Account) Reset() { - *x = Account{} - if protoimpl.UnsafeEnabled { - mi := &file_accounts_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Account) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Account) ProtoMessage() {} - -func (x *Account) ProtoReflect() protoreflect.Message { - mi := &file_accounts_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Account.ProtoReflect.Descriptor instead. +func (m *Account) Reset() { *m = Account{} } +func (m *Account) String() string { return proto.CompactTextString(m) } +func (*Account) ProtoMessage() {} func (*Account) Descriptor() ([]byte, []int) { - return file_accounts_proto_rawDescGZIP(), []int{2} + return fileDescriptor_e1e7723af4c007b7, []int{2} } -func (x *Account) GetUuid() string { - if x != nil { - return x.Uuid +func (m *Account) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Account.Unmarshal(m, b) +} +func (m *Account) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Account.Marshal(b, m, deterministic) +} +func (m *Account) XXX_Merge(src proto.Message) { + xxx_messageInfo_Account.Merge(m, src) +} +func (m *Account) XXX_Size() int { + return xxx_messageInfo_Account.Size(m) +} +func (m *Account) XXX_DiscardUnknown() { + xxx_messageInfo_Account.DiscardUnknown(m) +} + +var xxx_messageInfo_Account proto.InternalMessageInfo + +func (m *Account) GetStandardClaims() *StandardClaims { + if m != nil { + return m.StandardClaims + } + return nil +} + +func (m *Account) GetIdentities() []*IdHistory { + if m != nil { + return m.Identities + } + return nil +} + +func (m *Account) GetIssuer() string { + if m != nil { + return m.Issuer } return "" } -func (x *Account) GetStandardClaims() *StandardClaims { - if x != nil { - return x.StandardClaims +func (m *Account) GetPassword() string { + if m != nil { + return m.Password } - return nil -} - -func (x *Account) GetIdentities() []*IdHistory { - if x != nil { - return x.Identities - } - return nil + return "" } // OIDC standard claims https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims type StandardClaims struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sub string `protobuf:"bytes,1,opt,name=sub,proto3" json:"sub,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - GivenName string `protobuf:"bytes,3,opt,name=given_name,json=givenName,proto3" json:"given_name,omitempty"` - FamilyName string `protobuf:"bytes,4,opt,name=family_name,json=familyName,proto3" json:"family_name,omitempty"` - MiddleName string `protobuf:"bytes,5,opt,name=middle_name,json=middleName,proto3" json:"middle_name,omitempty"` - Nickname string `protobuf:"bytes,6,opt,name=nickname,proto3" json:"nickname,omitempty"` - PreferredUsername string `protobuf:"bytes,7,opt,name=preferred_username,json=preferredUsername,proto3" json:"preferred_username,omitempty"` - Profile string `protobuf:"bytes,8,opt,name=profile,proto3" json:"profile,omitempty"` - Picture string `protobuf:"bytes,9,opt,name=picture,proto3" json:"picture,omitempty"` - Website string `protobuf:"bytes,10,opt,name=website,proto3" json:"website,omitempty"` - Email string `protobuf:"bytes,11,opt,name=email,proto3" json:"email,omitempty"` - EmailVerified bool `protobuf:"varint,12,opt,name=email_verified,json=emailVerified,proto3" json:"email_verified,omitempty"` - Gender string `protobuf:"bytes,13,opt,name=gender,proto3" json:"gender,omitempty"` - Birthdate string `protobuf:"bytes,14,opt,name=birthdate,proto3" json:"birthdate,omitempty"` - Zoneinfo string `protobuf:"bytes,15,opt,name=zoneinfo,proto3" json:"zoneinfo,omitempty"` - Locale string `protobuf:"bytes,16,opt,name=locale,proto3" json:"locale,omitempty"` - PhoneNumber string `protobuf:"bytes,17,opt,name=phone_number,json=phoneNumber,proto3" json:"phone_number,omitempty"` - PhoneNumberVerified bool `protobuf:"varint,18,opt,name=phone_number_verified,json=phoneNumberVerified,proto3" json:"phone_number_verified,omitempty"` - UpdatedAt int32 `protobuf:"varint,19,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - Address *Address `protobuf:"bytes,20,opt,name=address,proto3" json:"address,omitempty"` + Sub string `protobuf:"bytes,1,opt,name=sub,proto3" json:"sub,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + GivenName string `protobuf:"bytes,3,opt,name=given_name,json=givenName,proto3" json:"given_name,omitempty"` + FamilyName string `protobuf:"bytes,4,opt,name=family_name,json=familyName,proto3" json:"family_name,omitempty"` + MiddleName string `protobuf:"bytes,5,opt,name=middle_name,json=middleName,proto3" json:"middle_name,omitempty"` + Nickname string `protobuf:"bytes,6,opt,name=nickname,proto3" json:"nickname,omitempty"` + PreferredUsername string `protobuf:"bytes,7,opt,name=preferred_username,json=preferredUsername,proto3" json:"preferred_username,omitempty"` + Profile string `protobuf:"bytes,8,opt,name=profile,proto3" json:"profile,omitempty"` + Picture string `protobuf:"bytes,9,opt,name=picture,proto3" json:"picture,omitempty"` + Website string `protobuf:"bytes,10,opt,name=website,proto3" json:"website,omitempty"` + Email string `protobuf:"bytes,11,opt,name=email,proto3" json:"email,omitempty"` + EmailVerified bool `protobuf:"varint,12,opt,name=email_verified,json=emailVerified,proto3" json:"email_verified,omitempty"` + Gender string `protobuf:"bytes,13,opt,name=gender,proto3" json:"gender,omitempty"` + Birthdate string `protobuf:"bytes,14,opt,name=birthdate,proto3" json:"birthdate,omitempty"` + Zoneinfo string `protobuf:"bytes,15,opt,name=zoneinfo,proto3" json:"zoneinfo,omitempty"` + Locale string `protobuf:"bytes,16,opt,name=locale,proto3" json:"locale,omitempty"` + PhoneNumber string `protobuf:"bytes,17,opt,name=phone_number,json=phoneNumber,proto3" json:"phone_number,omitempty"` + PhoneNumberVerified bool `protobuf:"varint,18,opt,name=phone_number_verified,json=phoneNumberVerified,proto3" json:"phone_number_verified,omitempty"` + UpdatedAt int32 `protobuf:"varint,19,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + Address *Address `protobuf:"bytes,20,opt,name=address,proto3" json:"address,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *StandardClaims) Reset() { - *x = StandardClaims{} - if protoimpl.UnsafeEnabled { - mi := &file_accounts_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StandardClaims) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StandardClaims) ProtoMessage() {} - -func (x *StandardClaims) ProtoReflect() protoreflect.Message { - mi := &file_accounts_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StandardClaims.ProtoReflect.Descriptor instead. +func (m *StandardClaims) Reset() { *m = StandardClaims{} } +func (m *StandardClaims) String() string { return proto.CompactTextString(m) } +func (*StandardClaims) ProtoMessage() {} func (*StandardClaims) Descriptor() ([]byte, []int) { - return file_accounts_proto_rawDescGZIP(), []int{3} + return fileDescriptor_e1e7723af4c007b7, []int{3} } -func (x *StandardClaims) GetSub() string { - if x != nil { - return x.Sub +func (m *StandardClaims) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_StandardClaims.Unmarshal(m, b) +} +func (m *StandardClaims) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_StandardClaims.Marshal(b, m, deterministic) +} +func (m *StandardClaims) XXX_Merge(src proto.Message) { + xxx_messageInfo_StandardClaims.Merge(m, src) +} +func (m *StandardClaims) XXX_Size() int { + return xxx_messageInfo_StandardClaims.Size(m) +} +func (m *StandardClaims) XXX_DiscardUnknown() { + xxx_messageInfo_StandardClaims.DiscardUnknown(m) +} + +var xxx_messageInfo_StandardClaims proto.InternalMessageInfo + +func (m *StandardClaims) GetSub() string { + if m != nil { + return m.Sub } return "" } -func (x *StandardClaims) GetName() string { - if x != nil { - return x.Name +func (m *StandardClaims) GetName() string { + if m != nil { + return m.Name } return "" } -func (x *StandardClaims) GetGivenName() string { - if x != nil { - return x.GivenName +func (m *StandardClaims) GetGivenName() string { + if m != nil { + return m.GivenName } return "" } -func (x *StandardClaims) GetFamilyName() string { - if x != nil { - return x.FamilyName +func (m *StandardClaims) GetFamilyName() string { + if m != nil { + return m.FamilyName } return "" } -func (x *StandardClaims) GetMiddleName() string { - if x != nil { - return x.MiddleName +func (m *StandardClaims) GetMiddleName() string { + if m != nil { + return m.MiddleName } return "" } -func (x *StandardClaims) GetNickname() string { - if x != nil { - return x.Nickname +func (m *StandardClaims) GetNickname() string { + if m != nil { + return m.Nickname } return "" } -func (x *StandardClaims) GetPreferredUsername() string { - if x != nil { - return x.PreferredUsername +func (m *StandardClaims) GetPreferredUsername() string { + if m != nil { + return m.PreferredUsername } return "" } -func (x *StandardClaims) GetProfile() string { - if x != nil { - return x.Profile +func (m *StandardClaims) GetProfile() string { + if m != nil { + return m.Profile } return "" } -func (x *StandardClaims) GetPicture() string { - if x != nil { - return x.Picture +func (m *StandardClaims) GetPicture() string { + if m != nil { + return m.Picture } return "" } -func (x *StandardClaims) GetWebsite() string { - if x != nil { - return x.Website +func (m *StandardClaims) GetWebsite() string { + if m != nil { + return m.Website } return "" } -func (x *StandardClaims) GetEmail() string { - if x != nil { - return x.Email +func (m *StandardClaims) GetEmail() string { + if m != nil { + return m.Email } return "" } -func (x *StandardClaims) GetEmailVerified() bool { - if x != nil { - return x.EmailVerified +func (m *StandardClaims) GetEmailVerified() bool { + if m != nil { + return m.EmailVerified } return false } -func (x *StandardClaims) GetGender() string { - if x != nil { - return x.Gender +func (m *StandardClaims) GetGender() string { + if m != nil { + return m.Gender } return "" } -func (x *StandardClaims) GetBirthdate() string { - if x != nil { - return x.Birthdate +func (m *StandardClaims) GetBirthdate() string { + if m != nil { + return m.Birthdate } return "" } -func (x *StandardClaims) GetZoneinfo() string { - if x != nil { - return x.Zoneinfo +func (m *StandardClaims) GetZoneinfo() string { + if m != nil { + return m.Zoneinfo } return "" } -func (x *StandardClaims) GetLocale() string { - if x != nil { - return x.Locale +func (m *StandardClaims) GetLocale() string { + if m != nil { + return m.Locale } return "" } -func (x *StandardClaims) GetPhoneNumber() string { - if x != nil { - return x.PhoneNumber +func (m *StandardClaims) GetPhoneNumber() string { + if m != nil { + return m.PhoneNumber } return "" } -func (x *StandardClaims) GetPhoneNumberVerified() bool { - if x != nil { - return x.PhoneNumberVerified +func (m *StandardClaims) GetPhoneNumberVerified() bool { + if m != nil { + return m.PhoneNumberVerified } return false } -func (x *StandardClaims) GetUpdatedAt() int32 { - if x != nil { - return x.UpdatedAt +func (m *StandardClaims) GetUpdatedAt() int32 { + if m != nil { + return m.UpdatedAt } return 0 } -func (x *StandardClaims) GetAddress() *Address { - if x != nil { - return x.Address +func (m *StandardClaims) GetAddress() *Address { + if m != nil { + return m.Address } return nil } type Address struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Formatted string `protobuf:"bytes,1,opt,name=formatted,proto3" json:"formatted,omitempty"` - StreetAddress string `protobuf:"bytes,2,opt,name=street_address,json=streetAddress,proto3" json:"street_address,omitempty"` - Locality string `protobuf:"bytes,3,opt,name=locality,proto3" json:"locality,omitempty"` - Region string `protobuf:"bytes,4,opt,name=region,proto3" json:"region,omitempty"` - PostalCode string `protobuf:"bytes,5,opt,name=postal_code,json=postalCode,proto3" json:"postal_code,omitempty"` - Country string `protobuf:"bytes,6,opt,name=country,proto3" json:"country,omitempty"` + Formatted string `protobuf:"bytes,1,opt,name=formatted,proto3" json:"formatted,omitempty"` + StreetAddress string `protobuf:"bytes,2,opt,name=street_address,json=streetAddress,proto3" json:"street_address,omitempty"` + Locality string `protobuf:"bytes,3,opt,name=locality,proto3" json:"locality,omitempty"` + Region string `protobuf:"bytes,4,opt,name=region,proto3" json:"region,omitempty"` + PostalCode string `protobuf:"bytes,5,opt,name=postal_code,json=postalCode,proto3" json:"postal_code,omitempty"` + Country string `protobuf:"bytes,6,opt,name=country,proto3" json:"country,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *Address) Reset() { - *x = Address{} - if protoimpl.UnsafeEnabled { - mi := &file_accounts_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Address) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Address) ProtoMessage() {} - -func (x *Address) ProtoReflect() protoreflect.Message { - mi := &file_accounts_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Address.ProtoReflect.Descriptor instead. +func (m *Address) Reset() { *m = Address{} } +func (m *Address) String() string { return proto.CompactTextString(m) } +func (*Address) ProtoMessage() {} func (*Address) Descriptor() ([]byte, []int) { - return file_accounts_proto_rawDescGZIP(), []int{4} + return fileDescriptor_e1e7723af4c007b7, []int{4} } -func (x *Address) GetFormatted() string { - if x != nil { - return x.Formatted +func (m *Address) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Address.Unmarshal(m, b) +} +func (m *Address) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Address.Marshal(b, m, deterministic) +} +func (m *Address) XXX_Merge(src proto.Message) { + xxx_messageInfo_Address.Merge(m, src) +} +func (m *Address) XXX_Size() int { + return xxx_messageInfo_Address.Size(m) +} +func (m *Address) XXX_DiscardUnknown() { + xxx_messageInfo_Address.DiscardUnknown(m) +} + +var xxx_messageInfo_Address proto.InternalMessageInfo + +func (m *Address) GetFormatted() string { + if m != nil { + return m.Formatted } return "" } -func (x *Address) GetStreetAddress() string { - if x != nil { - return x.StreetAddress +func (m *Address) GetStreetAddress() string { + if m != nil { + return m.StreetAddress } return "" } -func (x *Address) GetLocality() string { - if x != nil { - return x.Locality +func (m *Address) GetLocality() string { + if m != nil { + return m.Locality } return "" } -func (x *Address) GetRegion() string { - if x != nil { - return x.Region +func (m *Address) GetRegion() string { + if m != nil { + return m.Region } return "" } -func (x *Address) GetPostalCode() string { - if x != nil { - return x.PostalCode +func (m *Address) GetPostalCode() string { + if m != nil { + return m.PostalCode } return "" } -func (x *Address) GetCountry() string { - if x != nil { - return x.Country +func (m *Address) GetCountry() string { + if m != nil { + return m.Country } return "" } type IdHistory struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sub string `protobuf:"bytes,1,opt,name=sub,proto3" json:"sub,omitempty"` - Iss string `protobuf:"bytes,2,opt,name=iss,proto3" json:"iss,omitempty"` + Sub string `protobuf:"bytes,1,opt,name=sub,proto3" json:"sub,omitempty"` + Iss string `protobuf:"bytes,2,opt,name=iss,proto3" json:"iss,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *IdHistory) Reset() { - *x = IdHistory{} - if protoimpl.UnsafeEnabled { - mi := &file_accounts_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *IdHistory) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*IdHistory) ProtoMessage() {} - -func (x *IdHistory) ProtoReflect() protoreflect.Message { - mi := &file_accounts_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use IdHistory.ProtoReflect.Descriptor instead. +func (m *IdHistory) Reset() { *m = IdHistory{} } +func (m *IdHistory) String() string { return proto.CompactTextString(m) } +func (*IdHistory) ProtoMessage() {} func (*IdHistory) Descriptor() ([]byte, []int) { - return file_accounts_proto_rawDescGZIP(), []int{5} + return fileDescriptor_e1e7723af4c007b7, []int{5} } -func (x *IdHistory) GetSub() string { - if x != nil { - return x.Sub +func (m *IdHistory) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_IdHistory.Unmarshal(m, b) +} +func (m *IdHistory) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_IdHistory.Marshal(b, m, deterministic) +} +func (m *IdHistory) XXX_Merge(src proto.Message) { + xxx_messageInfo_IdHistory.Merge(m, src) +} +func (m *IdHistory) XXX_Size() int { + return xxx_messageInfo_IdHistory.Size(m) +} +func (m *IdHistory) XXX_DiscardUnknown() { + xxx_messageInfo_IdHistory.DiscardUnknown(m) +} + +var xxx_messageInfo_IdHistory proto.InternalMessageInfo + +func (m *IdHistory) GetSub() string { + if m != nil { + return m.Sub } return "" } -func (x *IdHistory) GetIss() string { - if x != nil { - return x.Iss +func (m *IdHistory) GetIss() string { + if m != nil { + return m.Iss } return "" } type Phoenix struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Theme string `protobuf:"bytes,1,opt,name=theme,proto3" json:"theme,omitempty"` + Theme string `protobuf:"bytes,1,opt,name=theme,proto3" json:"theme,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *Phoenix) Reset() { - *x = Phoenix{} - if protoimpl.UnsafeEnabled { - mi := &file_accounts_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Phoenix) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Phoenix) ProtoMessage() {} - -func (x *Phoenix) ProtoReflect() protoreflect.Message { - mi := &file_accounts_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Phoenix.ProtoReflect.Descriptor instead. +func (m *Phoenix) Reset() { *m = Phoenix{} } +func (m *Phoenix) String() string { return proto.CompactTextString(m) } +func (*Phoenix) ProtoMessage() {} func (*Phoenix) Descriptor() ([]byte, []int) { - return file_accounts_proto_rawDescGZIP(), []int{6} + return fileDescriptor_e1e7723af4c007b7, []int{6} } -func (x *Phoenix) GetTheme() string { - if x != nil { - return x.Theme +func (m *Phoenix) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Phoenix.Unmarshal(m, b) +} +func (m *Phoenix) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Phoenix.Marshal(b, m, deterministic) +} +func (m *Phoenix) XXX_Merge(src proto.Message) { + xxx_messageInfo_Phoenix.Merge(m, src) +} +func (m *Phoenix) XXX_Size() int { + return xxx_messageInfo_Phoenix.Size(m) +} +func (m *Phoenix) XXX_DiscardUnknown() { + xxx_messageInfo_Phoenix.DiscardUnknown(m) +} + +var xxx_messageInfo_Phoenix proto.InternalMessageInfo + +func (m *Phoenix) GetTheme() string { + if m != nil { + return m.Theme } return "" } // Used to fetch exactly one user. The conditions are optional. If set, all have to be true. type GetRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - // Used to look up user by the oidc sub and iss Identity *IdHistory `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` // Used to look up the user by our internal uuid @@ -594,81 +537,73 @@ type GetRequest struct { Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` // Used as a fallback mechanism in case sub or iss changed for an existing user - Email string `protobuf:"bytes,5,opt,name=email,proto3" json:"email,omitempty"` + Email string `protobuf:"bytes,5,opt,name=email,proto3" json:"email,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *GetRequest) Reset() { - *x = GetRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_accounts_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRequest) ProtoMessage() {} - -func (x *GetRequest) ProtoReflect() protoreflect.Message { - mi := &file_accounts_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRequest.ProtoReflect.Descriptor instead. +func (m *GetRequest) Reset() { *m = GetRequest{} } +func (m *GetRequest) String() string { return proto.CompactTextString(m) } +func (*GetRequest) ProtoMessage() {} func (*GetRequest) Descriptor() ([]byte, []int) { - return file_accounts_proto_rawDescGZIP(), []int{7} + return fileDescriptor_e1e7723af4c007b7, []int{7} } -func (x *GetRequest) GetIdentity() *IdHistory { - if x != nil { - return x.Identity +func (m *GetRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetRequest.Unmarshal(m, b) +} +func (m *GetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetRequest.Marshal(b, m, deterministic) +} +func (m *GetRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetRequest.Merge(m, src) +} +func (m *GetRequest) XXX_Size() int { + return xxx_messageInfo_GetRequest.Size(m) +} +func (m *GetRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetRequest proto.InternalMessageInfo + +func (m *GetRequest) GetIdentity() *IdHistory { + if m != nil { + return m.Identity } return nil } -func (x *GetRequest) GetUuid() string { - if x != nil { - return x.Uuid +func (m *GetRequest) GetUuid() string { + if m != nil { + return m.Uuid } return "" } -func (x *GetRequest) GetUsername() string { - if x != nil { - return x.Username +func (m *GetRequest) GetUsername() string { + if m != nil { + return m.Username } return "" } -func (x *GetRequest) GetPassword() string { - if x != nil { - return x.Password +func (m *GetRequest) GetPassword() string { + if m != nil { + return m.Password } return "" } -func (x *GetRequest) GetEmail() string { - if x != nil { - return x.Email +func (m *GetRequest) GetEmail() string { + if m != nil { + return m.Email } return "" } type Query struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - // Optional. The maximum number of accounts to return in the response. PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // Optional. A pagination token returned from a previous call to `Get` @@ -695,428 +630,180 @@ type Query struct { // an address in Germany // * Query `name=\\"Test String\\"` returns accounts with // display names that include both "Test" and "String". - Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` + Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *Query) Reset() { - *x = Query{} - if protoimpl.UnsafeEnabled { - mi := &file_accounts_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Query) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Query) ProtoMessage() {} - -func (x *Query) ProtoReflect() protoreflect.Message { - mi := &file_accounts_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Query.ProtoReflect.Descriptor instead. +func (m *Query) Reset() { *m = Query{} } +func (m *Query) String() string { return proto.CompactTextString(m) } +func (*Query) ProtoMessage() {} func (*Query) Descriptor() ([]byte, []int) { - return file_accounts_proto_rawDescGZIP(), []int{8} + return fileDescriptor_e1e7723af4c007b7, []int{8} } -func (x *Query) GetPageSize() int32 { - if x != nil { - return x.PageSize +func (m *Query) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Query.Unmarshal(m, b) +} +func (m *Query) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Query.Marshal(b, m, deterministic) +} +func (m *Query) XXX_Merge(src proto.Message) { + xxx_messageInfo_Query.Merge(m, src) +} +func (m *Query) XXX_Size() int { + return xxx_messageInfo_Query.Size(m) +} +func (m *Query) XXX_DiscardUnknown() { + xxx_messageInfo_Query.DiscardUnknown(m) +} + +var xxx_messageInfo_Query proto.InternalMessageInfo + +func (m *Query) GetPageSize() int32 { + if m != nil { + return m.PageSize } return 0 } -func (x *Query) GetPageToken() string { - if x != nil { - return x.PageToken +func (m *Query) GetPageToken() string { + if m != nil { + return m.PageToken } return "" } -func (x *Query) GetQuery() string { - if x != nil { - return x.Query +func (m *Query) GetQuery() string { + if m != nil { + return m.Query } return "" } type Records struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - // A possibly paginated accounts search result for // the specified query. Records []*Record `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` // A pagination token returned from a previous call to `Search` // that indicates from where searching should continue. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *Records) Reset() { - *x = Records{} - if protoimpl.UnsafeEnabled { - mi := &file_accounts_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Records) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Records) ProtoMessage() {} - -func (x *Records) ProtoReflect() protoreflect.Message { - mi := &file_accounts_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Records.ProtoReflect.Descriptor instead. +func (m *Records) Reset() { *m = Records{} } +func (m *Records) String() string { return proto.CompactTextString(m) } +func (*Records) ProtoMessage() {} func (*Records) Descriptor() ([]byte, []int) { - return file_accounts_proto_rawDescGZIP(), []int{9} + return fileDescriptor_e1e7723af4c007b7, []int{9} } -func (x *Records) GetRecords() []*Record { - if x != nil { - return x.Records +func (m *Records) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Records.Unmarshal(m, b) +} +func (m *Records) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Records.Marshal(b, m, deterministic) +} +func (m *Records) XXX_Merge(src proto.Message) { + xxx_messageInfo_Records.Merge(m, src) +} +func (m *Records) XXX_Size() int { + return xxx_messageInfo_Records.Size(m) +} +func (m *Records) XXX_DiscardUnknown() { + xxx_messageInfo_Records.DiscardUnknown(m) +} + +var xxx_messageInfo_Records proto.InternalMessageInfo + +func (m *Records) GetRecords() []*Record { + if m != nil { + return m.Records } return nil } -func (x *Records) GetNextPageToken() string { - if x != nil { - return x.NextPageToken +func (m *Records) GetNextPageToken() string { + if m != nil { + return m.NextPageToken } return "" } -var File_accounts_proto protoreflect.FileDescriptor - -var file_accounts_proto_rawDesc = []byte{ - 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, - 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x47, 0x0a, 0x06, 0x52, - 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2b, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x07, 0x70, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x36, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, - 0x2b, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x11, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x95, 0x01, 0x0a, - 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x41, 0x0a, 0x0f, - 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x2e, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x52, - 0x0e, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x12, - 0x33, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x49, - 0x64, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x74, 0x69, 0x65, 0x73, 0x22, 0xfa, 0x04, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, - 0x64, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x62, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x75, 0x62, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, - 0x0a, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, - 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, - 0x0b, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, - 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x12, 0x70, 0x72, - 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, - 0x64, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x6f, - 0x66, 0x69, 0x6c, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x66, - 0x69, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x69, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x69, 0x63, 0x74, 0x75, 0x72, 0x65, 0x12, 0x18, 0x0a, - 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x25, 0x0a, - 0x0e, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, - 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x56, 0x65, 0x72, 0x69, - 0x66, 0x69, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x0d, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, - 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x74, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x7a, 0x6f, - 0x6e, 0x65, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x7a, 0x6f, - 0x6e, 0x65, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, - 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x21, - 0x0a, 0x0c, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x11, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x12, 0x32, 0x0a, 0x15, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x13, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x56, 0x65, 0x72, - 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, - 0x5f, 0x61, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x64, 0x41, 0x74, 0x12, 0x2b, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, - 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x22, 0xbd, 0x01, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, - 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x73, - 0x74, 0x72, 0x65, 0x65, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x74, 0x72, 0x65, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x16, - 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6f, 0x73, 0x74, 0x61, 0x6c, - 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6f, 0x73, - 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x72, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, - 0x79, 0x22, 0x2f, 0x0a, 0x09, 0x49, 0x64, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x73, 0x75, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x75, 0x62, - 0x12, 0x10, 0x0a, 0x03, 0x69, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x69, - 0x73, 0x73, 0x22, 0x1f, 0x0a, 0x07, 0x50, 0x68, 0x6f, 0x65, 0x6e, 0x69, 0x78, 0x12, 0x14, 0x0a, - 0x05, 0x74, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x68, - 0x65, 0x6d, 0x65, 0x22, 0x9f, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, - 0x49, 0x64, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, - 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0x63, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x20, - 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, - 0x12, 0x22, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x5d, 0x0a, 0x07, 0x52, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x73, 0x12, 0x2a, 0x0a, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, - 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0x99, 0x01, 0x0a, 0x0f, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x29, 0x0a, - 0x03, 0x53, 0x65, 0x74, 0x12, 0x10, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, - 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x1a, 0x10, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x2d, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, - 0x14, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x2c, 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x12, 0x0f, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x1a, 0x11, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x52, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x73, 0x42, 0x14, 0x5a, 0x12, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x76, 0x30, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, +func init() { + proto.RegisterType((*Record)(nil), "settings.Record") + proto.RegisterType((*Payload)(nil), "settings.Payload") + proto.RegisterType((*Account)(nil), "settings.Account") + proto.RegisterType((*StandardClaims)(nil), "settings.StandardClaims") + proto.RegisterType((*Address)(nil), "settings.Address") + proto.RegisterType((*IdHistory)(nil), "settings.IdHistory") + proto.RegisterType((*Phoenix)(nil), "settings.Phoenix") + proto.RegisterType((*GetRequest)(nil), "settings.GetRequest") + proto.RegisterType((*Query)(nil), "settings.Query") + proto.RegisterType((*Records)(nil), "settings.Records") } -var ( - file_accounts_proto_rawDescOnce sync.Once - file_accounts_proto_rawDescData = file_accounts_proto_rawDesc -) +func init() { proto.RegisterFile("accounts.proto", fileDescriptor_e1e7723af4c007b7) } -func file_accounts_proto_rawDescGZIP() []byte { - file_accounts_proto_rawDescOnce.Do(func() { - file_accounts_proto_rawDescData = protoimpl.X.CompressGZIP(file_accounts_proto_rawDescData) - }) - return file_accounts_proto_rawDescData -} - -var file_accounts_proto_msgTypes = make([]protoimpl.MessageInfo, 10) -var file_accounts_proto_goTypes = []interface{}{ - (*Record)(nil), // 0: settings.Record - (*Payload)(nil), // 1: settings.Payload - (*Account)(nil), // 2: settings.Account - (*StandardClaims)(nil), // 3: settings.StandardClaims - (*Address)(nil), // 4: settings.Address - (*IdHistory)(nil), // 5: settings.IdHistory - (*Phoenix)(nil), // 6: settings.Phoenix - (*GetRequest)(nil), // 7: settings.GetRequest - (*Query)(nil), // 8: settings.Query - (*Records)(nil), // 9: settings.Records -} -var file_accounts_proto_depIdxs = []int32{ - 1, // 0: settings.Record.payload:type_name -> settings.Payload - 2, // 1: settings.Payload.account:type_name -> settings.Account - 3, // 2: settings.Account.standard_claims:type_name -> settings.StandardClaims - 5, // 3: settings.Account.identities:type_name -> settings.IdHistory - 4, // 4: settings.StandardClaims.address:type_name -> settings.Address - 5, // 5: settings.GetRequest.identity:type_name -> settings.IdHistory - 0, // 6: settings.Records.records:type_name -> settings.Record - 0, // 7: settings.AccountsService.Set:input_type -> settings.Record - 7, // 8: settings.AccountsService.Get:input_type -> settings.GetRequest - 8, // 9: settings.AccountsService.Search:input_type -> settings.Query - 0, // 10: settings.AccountsService.Set:output_type -> settings.Record - 0, // 11: settings.AccountsService.Get:output_type -> settings.Record - 9, // 12: settings.AccountsService.Search:output_type -> settings.Records - 10, // [10:13] is the sub-list for method output_type - 7, // [7:10] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name -} - -func init() { file_accounts_proto_init() } -func file_accounts_proto_init() { - if File_accounts_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_accounts_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Record); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_accounts_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Payload); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_accounts_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Account); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_accounts_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StandardClaims); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_accounts_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Address); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_accounts_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IdHistory); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_accounts_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Phoenix); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_accounts_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_accounts_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Query); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_accounts_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Records); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_accounts_proto_rawDesc, - NumEnums: 0, - NumMessages: 10, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_accounts_proto_goTypes, - DependencyIndexes: file_accounts_proto_depIdxs, - MessageInfos: file_accounts_proto_msgTypes, - }.Build() - File_accounts_proto = out.File - file_accounts_proto_rawDesc = nil - file_accounts_proto_goTypes = nil - file_accounts_proto_depIdxs = nil +var fileDescriptor_e1e7723af4c007b7 = []byte{ + // 882 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x55, 0x4b, 0x6f, 0x1b, 0x37, + 0x10, 0xc6, 0x46, 0xd6, 0x6b, 0x14, 0x4b, 0x36, 0xed, 0x16, 0x84, 0xd0, 0xc0, 0xea, 0x02, 0x2d, + 0xd4, 0x47, 0xac, 0xc2, 0x01, 0x7a, 0xe9, 0xc9, 0xc9, 0xc1, 0xcd, 0x25, 0x70, 0x57, 0x6d, 0x0f, + 0x05, 0x8a, 0x05, 0xb5, 0x1c, 0x49, 0x84, 0x57, 0xcb, 0x0d, 0xc9, 0x55, 0x22, 0xff, 0x93, 0x9e, + 0xfa, 0x2b, 0x7a, 0xec, 0x7f, 0xe9, 0xef, 0xe8, 0x29, 0xe0, 0x63, 0x57, 0x7e, 0x9d, 0xc4, 0xef, + 0xc1, 0xe1, 0x70, 0x76, 0x86, 0x82, 0x21, 0xcb, 0x32, 0x59, 0x15, 0x46, 0x9f, 0x97, 0x4a, 0x1a, + 0x49, 0x7a, 0x1a, 0x8d, 0x11, 0xc5, 0x4a, 0x8f, 0xcf, 0x56, 0x52, 0xae, 0x72, 0x9c, 0xb1, 0x52, + 0xcc, 0x96, 0x02, 0x73, 0x9e, 0x2e, 0x70, 0xcd, 0xb6, 0x42, 0x2a, 0x6f, 0x8d, 0xaf, 0xa0, 0x93, + 0x60, 0x26, 0x15, 0x27, 0x47, 0xd0, 0xba, 0xc1, 0x1d, 0x8d, 0x26, 0xd1, 0xb4, 0x9f, 0xd8, 0x25, + 0xf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x00, 0x00, 0xff, 0xff, 0x02, 0xb9, 0x9c, 0x08, 0x23, 0x07, + 0x00, 0x00, } diff --git a/pkg/proto/v0/accounts.proto b/pkg/proto/v0/accounts.proto index 9b559cc00..1bc78f527 100644 --- a/pkg/proto/v0/accounts.proto +++ b/pkg/proto/v0/accounts.proto @@ -22,9 +22,10 @@ message Payload { } message Account { - string uuid = 1; - StandardClaims standard_claims = 2; - repeated IdHistory identities = 3; // keep track of every identity of a given user + StandardClaims standard_claims = 1; + repeated IdHistory identities = 2; // keep track of every identity of a given user + string Issuer = 3; + string Password = 4; } // OIDC standard claims https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims diff --git a/pkg/service/v0/service.go b/pkg/service/v0/service.go index 7508c8a92..946c5827c 100644 --- a/pkg/service/v0/service.go +++ b/pkg/service/v0/service.go @@ -2,6 +2,7 @@ package service import ( "context" + "errors" "github.com/owncloud/ocis-accounts/pkg/account" "github.com/owncloud/ocis-accounts/pkg/config" @@ -46,15 +47,68 @@ func (s Service) Set(c context.Context, req *proto.Record, res *proto.Record) er } // Get implements the AccountsServiceHandler interface -func (s Service) Get(c context.Context, req *proto.GetRequest, res *proto.Record) error { +func (s Service) Get(c context.Context, req *proto.GetRequest, res *proto.Record) (err error) { // TODO implement other GetRequest properties: Identity, username&password, email - r, err := s.Manager.Read(req.GetUuid()) - if err != nil { - return err + var r, ruuid, rname, rmail *proto.Record + if req.GetIdentity() != nil { + r, err = s.Manager.ReadByIdentity(req.GetIdentity()) + if err != nil { + return err + } + } + if req.GetUuid() != "" { + ruuid, err = s.Manager.Read(req.GetUuid()) + if err != nil { + return err + } + + if r == nil { + r = ruuid + } else if r.Key != ruuid.Key { + r = nil + return errors.New("uuid mismatch") + } + } + if req.GetUsername() != "" { + rname, err = s.Manager.ReadByUsername(req.GetUsername()) + if err != nil { + return err + } + if r == nil { + r = rname + } else if r.Key != rname.Key { + r = nil + return errors.New("username mismatch") + } + } + if req.GetEmail() != "" { + rmail, err = s.Manager.ReadByEmail(req.GetEmail()) + if err != nil { + return err + } + if r == nil { + r = rmail + } else if r.Key != rmail.Key { + r = nil + return errors.New("email mismatch") + } } - res.Payload = r.GetPayload() - return nil + if r != nil { + // TODO store only salted hash + if req.GetPassword() != "" { + if r.Payload.Account.Password != req.GetPassword() { + return errors.New("wrong password") + } + } + res.Key = r.Key + res.Payload = r.GetPayload() + // password never leaves + res.Payload.Account.Password = "" + return nil + } + + return errors.New("at least one request param must be set") } // Search implements the AccountsServiceHandler interface diff --git a/pkg/store/filesystem/store.go b/pkg/store/filesystem/store.go index e7d8adbaa..6677638f1 100644 --- a/pkg/store/filesystem/store.go +++ b/pkg/store/filesystem/store.go @@ -8,6 +8,7 @@ import ( "os" "path" "path/filepath" + "strings" // gproto "github.com/golang/protobuf/proto" "github.com/owncloud/ocis-accounts/pkg/account" @@ -20,6 +21,10 @@ var ( // StoreName is the default name for the accounts store StoreName = "ocis-store" managerName = "filesystem" + uuidSpace = "uuid" + usernameSpace = "username" + emailSpace = "email" + identitySpace = "identity" emptyKeyError = "key cannot be empty" ) @@ -53,7 +58,7 @@ func New(cfg *config.Config) account.Manager { // List returns all the identities in the mountPath folder func (s Store) List() ([]*proto.Record, error) { records := []*proto.Record{} - identities, err := ioutil.ReadDir(s.mountPath) + identities, err := ioutil.ReadDir(path.Join(s.mountPath, uuidSpace)) if err != nil { s.Logger.Err(err).Msgf("error reading %v", s.mountPath) return nil, err @@ -69,24 +74,10 @@ func (s Store) List() ([]*proto.Record, error) { return records, nil } -// NewRecord initializes a new record with the given options -func NewRecord(options ...Option) *proto.Record { - opts := NewOptions(options...) - - return &proto.Record{ - Payload: &proto.Payload{ - Account: &proto.Account{ - Uuid: opts.UUID, - }, - }, - } -} - -// Read implements the store interface. This implementation only reads by id. -func (s Store) Read(key string) (*proto.Record, error) { - contents, err := ioutil.ReadFile(path.Join(s.mountPath, key)) +func (s Store) readSpace(space string, subspace string, key string) (*proto.Record, error) { + contents, err := ioutil.ReadFile(path.Join(s.mountPath, space, subspace, key)) if err != nil { - s.Logger.Err(err).Msgf("error reading contents of key %v: file not found", key) + s.Logger.Err(err).Str("space", space).Str("subspace", subspace).Str("key", key).Msg("error reading record") return nil, err } @@ -102,15 +93,45 @@ func (s Store) Read(key string) (*proto.Record, error) { return rec, nil } +// Read implements the store interface. This implementation only reads by id. +func (s Store) Read(uuid string) (*proto.Record, error) { + return s.readSpace(uuidSpace, "", uuid) +} + +// ReadByUsername implements the store interface. This implementation only reads by username. +func (s Store) ReadByUsername(username string) (*proto.Record, error) { + return s.readSpace(usernameSpace, "", username) +} + +// ReadByEmail implements the store interface. This implementation only reads by email. +func (s Store) ReadByEmail(email string) (*proto.Record, error) { + i := strings.LastIndex(email, "@") + if i < 0 { + // no domain part + return s.readSpace(emailSpace, "local", email) + } + + return s.readSpace(emailSpace, email[:i], email[i:]) +} + +// ReadByIdentity implements the store interface. This implementation only reads by iss & sub. +func (s Store) ReadByIdentity(identity *proto.IdHistory) (*proto.Record, error) { + if identity.Iss == "" { + s.Logger.Error().Msg("iss cannot be empty") + return nil, fmt.Errorf(emptyKeyError) + } + return s.readSpace(identitySpace, identity.Iss, identity.Sub) +} + // Write implements the store interface func (s Store) Write(rec *proto.Record) (*proto.Record, error) { - path := filepath.Join(s.mountPath, rec.Key) - if len(rec.Key) < 1 { s.Logger.Error().Msg("key cannot be empty") return nil, fmt.Errorf(emptyKeyError) } + path := filepath.Join(s.mountPath, uuidSpace, rec.Key) + contents, err := json.Marshal(rec) if err != nil { s.Logger.Err(err).Msg("record could not be marshaled") @@ -120,8 +141,50 @@ func (s Store) Write(rec *proto.Record) (*proto.Record, error) { if err := ioutil.WriteFile(path, contents, 0644); err != nil { return nil, err } + s.Logger.Info().Int("bytes", len(contents)).Str("path", path).Msg("wrote account") + + // write symlinks for other lookups + // use hardlinks? + // TODO what if target already exists? use dirs with multiple symlinks to uuid? + // TODO what if username or email changes? use uuid folder with a file per property? srsly ... we should use a proper storage for this + if rec.Payload != nil { + if rec.Payload.Account != nil { + if rec.Payload.Account.StandardClaims != nil { + if rec.Payload.Account.StandardClaims.PreferredUsername != "" { + p := filepath.Join(s.mountPath, usernameSpace, rec.Payload.Account.StandardClaims.PreferredUsername) + os.MkdirAll(filepath.Dir(p), 0700) + os.Symlink(path, p) + } else { + s.Logger.Warn().Str("uuid", rec.Key).Msg("has no preferred username in standard claims") + } + if rec.Payload.Account.StandardClaims.Email != "" { + p := filepath.Join(s.mountPath, emailSpace, rec.Payload.Account.StandardClaims.Email) + os.MkdirAll(filepath.Dir(p), 0700) + os.Symlink(path, p) + } else { + s.Logger.Warn().Str("uuid", rec.Key).Msg("has no email in standard claims") + } + if rec.Payload.Account.Issuer != "" { + if rec.Payload.Account.StandardClaims.Sub != "" { + p := filepath.Join(s.mountPath, identitySpace, rec.Payload.Account.Issuer, rec.Payload.Account.StandardClaims.Sub) + os.MkdirAll(filepath.Dir(p), 0700) + os.Symlink(path, p) + } else { + s.Logger.Warn().Str("uuid", rec.Key).Msg("has no sub in standard claims") + } + } else { + s.Logger.Warn().Str("uuid", rec.Key).Msg("has no issuer in account") + } + } else { + s.Logger.Warn().Str("uuid", rec.Key).Msg("has no standard claims in account") + } + } else { + s.Logger.Warn().Str("uuid", rec.Key).Msg("has no account in payload") + } + } else { + s.Logger.Warn().Str("uuid", rec.Key).Msg("has no payload") + } - s.Logger.Info().Msgf("%v bytes written to %v", len(contents), path) return rec, nil }