mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-11 19:04:35 +00:00
User service changes part 3 (#163)
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,5 @@
|
|||||||
api-protobuf.json
|
api-protobuf.json
|
||||||
api-*.json
|
api-*.json
|
||||||
redoc-static.html
|
redoc-static.html
|
||||||
!docs
|
!docs
|
||||||
|
node_modules
|
||||||
|
|||||||
2
go.mod
2
go.mod
@@ -36,6 +36,8 @@ require (
|
|||||||
github.com/patrickmn/go-cache v2.1.0+incompatible
|
github.com/patrickmn/go-cache v2.1.0+incompatible
|
||||||
github.com/paulmach/go.geo v0.0.0-20180829195134-22b514266d33
|
github.com/paulmach/go.geo v0.0.0-20180829195134-22b514266d33
|
||||||
github.com/pquerna/otp v1.3.0
|
github.com/pquerna/otp v1.3.0
|
||||||
|
github.com/sendgrid/rest v2.6.4+incompatible // indirect
|
||||||
|
github.com/sendgrid/sendgrid-go v3.10.0+incompatible
|
||||||
github.com/stoewer/go-strcase v1.2.0
|
github.com/stoewer/go-strcase v1.2.0
|
||||||
github.com/stretchr/testify v1.7.0
|
github.com/stretchr/testify v1.7.0
|
||||||
github.com/teris-io/shortid v0.0.0-20171029131806-771a37caa5cf
|
github.com/teris-io/shortid v0.0.0-20171029131806-771a37caa5cf
|
||||||
|
|||||||
6
go.sum
6
go.sum
@@ -470,6 +470,12 @@ github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0
|
|||||||
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||||
github.com/sacloud/libsacloud v1.26.1/go.mod h1:79ZwATmHLIFZIMd7sxA3LwzVy/B77uj3LDoToVTxDoQ=
|
github.com/sacloud/libsacloud v1.26.1/go.mod h1:79ZwATmHLIFZIMd7sxA3LwzVy/B77uj3LDoToVTxDoQ=
|
||||||
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
|
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
|
||||||
|
github.com/sendgrid/rest v1.0.2 h1:xdfALkR1m9eqf41/zEnUmV0fw4b31ZzGZ4Dj5f2/w04=
|
||||||
|
github.com/sendgrid/rest v2.6.4+incompatible h1:lq6gAQxLwVBf3mVyCCSHI6mgF+NfaJFJHjT0kl6SSo8=
|
||||||
|
github.com/sendgrid/rest v2.6.4+incompatible/go.mod h1:kXX7q3jZtJXK5c5qK83bSGMdV6tsOE70KbHoqJls4lE=
|
||||||
|
github.com/sendgrid/sendgrid-go v1.2.0 h1:2K3teZdhaPe12ftFyFL4AWDH4QmNPc+sCi6mWFx5+oo=
|
||||||
|
github.com/sendgrid/sendgrid-go v3.10.0+incompatible h1:aSYyurHxEZSDy7kxhvZ4fH0inNkEEmRssZNbAmETR2c=
|
||||||
|
github.com/sendgrid/sendgrid-go v3.10.0+incompatible/go.mod h1:QRQt+LX/NmgVEvmdRw0VT/QgUn499+iza2FnDca9fg8=
|
||||||
github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516 h1:ofR1ZdrNSkiWcMsRrubK9tb2/SlZVWttAfqUjJi6QYc=
|
github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516 h1:ofR1ZdrNSkiWcMsRrubK9tb2/SlZVWttAfqUjJi6QYc=
|
||||||
github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516/go.mod h1:Yow6lPLSAXx2ifx470yD/nUe22Dv5vBvxK/UK9UUTVs=
|
github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516/go.mod h1:Yow6lPLSAXx2ifx470yD/nUe22Dv5vBvxK/UK9UUTVs=
|
||||||
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
|
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
|
||||||
|
|||||||
@@ -5,12 +5,19 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/url"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
_struct "github.com/golang/protobuf/ptypes/struct"
|
_struct "github.com/golang/protobuf/ptypes/struct"
|
||||||
|
"github.com/google/uuid"
|
||||||
|
"github.com/micro/micro/v3/service/config"
|
||||||
"github.com/micro/micro/v3/service/logger"
|
"github.com/micro/micro/v3/service/logger"
|
||||||
db "github.com/micro/services/db/proto"
|
db "github.com/micro/services/db/proto"
|
||||||
user "github.com/micro/services/user/proto"
|
user "github.com/micro/services/user/proto"
|
||||||
|
|
||||||
|
"github.com/sendgrid/sendgrid-go"
|
||||||
|
"github.com/sendgrid/sendgrid-go/helpers/mail"
|
||||||
)
|
)
|
||||||
|
|
||||||
type pw struct {
|
type pw struct {
|
||||||
@@ -19,14 +26,46 @@ type pw struct {
|
|||||||
Salt string `json:"salt"`
|
Salt string `json:"salt"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type verificationToken struct {
|
||||||
|
ID string `json:"id"`
|
||||||
|
UserID string `json:"userId"`
|
||||||
|
}
|
||||||
|
|
||||||
type Domain struct {
|
type Domain struct {
|
||||||
db db.DbService
|
db db.DbService
|
||||||
|
sengridKey string
|
||||||
}
|
}
|
||||||
|
|
||||||
func New(db db.DbService) *Domain {
|
func New(db db.DbService) *Domain {
|
||||||
return &Domain{
|
var key string
|
||||||
db: db,
|
cfg, err := config.Get("micro.user.sendgrid.api_key")
|
||||||
|
if err == nil {
|
||||||
|
key = cfg.String("")
|
||||||
}
|
}
|
||||||
|
if len(key) == 0 {
|
||||||
|
logger.Info("No email key found")
|
||||||
|
} else {
|
||||||
|
logger.Info("Email key found")
|
||||||
|
}
|
||||||
|
return &Domain{
|
||||||
|
sengridKey: key,
|
||||||
|
db: db,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (domain *Domain) SendEmail(fromName, toAddress, toUsername, subject, textContent, token, redirctUrl string) error {
|
||||||
|
if domain.sengridKey == "" {
|
||||||
|
return fmt.Errorf("empty email api key")
|
||||||
|
}
|
||||||
|
from := mail.NewEmail(fromName, "support@m3o.com")
|
||||||
|
to := mail.NewEmail(toUsername, toAddress)
|
||||||
|
textContent = strings.Replace(textContent, "$micro_verification_link", "https://angry-cori-854281.netlify.app?token="+token+"&redirectUrl="+url.QueryEscape(redirctUrl), -1)
|
||||||
|
message := mail.NewSingleEmail(from, subject, to, textContent, "")
|
||||||
|
client := sendgrid.NewSendClient(domain.sengridKey)
|
||||||
|
response, err := client.Send(message)
|
||||||
|
logger.Info(response)
|
||||||
|
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (domain *Domain) CreateSession(ctx context.Context, sess *user.Session) error {
|
func (domain *Domain) CreateSession(ctx context.Context, sess *user.Session) error {
|
||||||
@@ -59,6 +98,44 @@ func (domain *Domain) DeleteSession(ctx context.Context, id string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ReadToken returns the user id
|
||||||
|
func (domain *Domain) ReadToken(ctx context.Context, tokenId string) (string, error) {
|
||||||
|
token := &verificationToken{}
|
||||||
|
|
||||||
|
rsp, err := domain.db.Read(ctx, &db.ReadRequest{
|
||||||
|
Table: "tokens",
|
||||||
|
Query: fmt.Sprintf("id == '%v'", tokenId),
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
if len(rsp.Records) == 0 {
|
||||||
|
return "", errors.New("not found")
|
||||||
|
}
|
||||||
|
m, _ := rsp.Records[0].MarshalJSON()
|
||||||
|
json.Unmarshal(m, token)
|
||||||
|
return token.UserID, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateToken returns the created and saved token
|
||||||
|
func (domain *Domain) CreateToken(ctx context.Context, userId string) (string, error) {
|
||||||
|
s := &_struct.Struct{}
|
||||||
|
tokenId := uuid.New().String()
|
||||||
|
jso, _ := json.Marshal(verificationToken{
|
||||||
|
ID: tokenId,
|
||||||
|
UserID: userId,
|
||||||
|
})
|
||||||
|
err := s.UnmarshalJSON(jso)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
_, err = domain.db.Create(ctx, &db.CreateRequest{
|
||||||
|
Table: "tokens",
|
||||||
|
Record: s,
|
||||||
|
})
|
||||||
|
return tokenId, err
|
||||||
|
}
|
||||||
|
|
||||||
func (domain *Domain) ReadSession(ctx context.Context, id string) (*user.Session, error) {
|
func (domain *Domain) ReadSession(ctx context.Context, id string) (*user.Session, error) {
|
||||||
sess := &user.Session{}
|
sess := &user.Session{}
|
||||||
if len(id) == 0 {
|
if len(id) == 0 {
|
||||||
@@ -143,12 +220,12 @@ func (domain *Domain) Update(ctx context.Context, user *user.Account) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (domain *Domain) Read(ctx context.Context, id string) (*user.Account, error) {
|
func (domain *Domain) Read(ctx context.Context, userId string) (*user.Account, error) {
|
||||||
user := &user.Account{}
|
user := &user.Account{}
|
||||||
if len(id) == 0 {
|
if len(userId) == 0 {
|
||||||
return nil, fmt.Errorf("no id provided")
|
return nil, fmt.Errorf("no id provided")
|
||||||
}
|
}
|
||||||
q := fmt.Sprintf("id == '%v'", id)
|
q := fmt.Sprintf("id == '%v'", userId)
|
||||||
logger.Infof("Running query: %v", q)
|
logger.Infof("Running query: %v", q)
|
||||||
rsp, err := domain.db.Read(ctx, &db.ReadRequest{
|
rsp, err := domain.db.Read(ctx, &db.ReadRequest{
|
||||||
Table: "users",
|
Table: "users",
|
||||||
@@ -211,21 +288,12 @@ func (domain *Domain) UpdatePassword(ctx context.Context, id string, salt string
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (domain *Domain) SaltAndPassword(ctx context.Context, username, email string) (string, string, error) {
|
func (domain *Domain) SaltAndPassword(ctx context.Context, userId string) (string, string, error) {
|
||||||
var query string
|
|
||||||
if len(username) > 0 {
|
|
||||||
query = fmt.Sprintf("username == '%v'", username)
|
|
||||||
} else if len(email) > 0 {
|
|
||||||
query = fmt.Sprintf("email == '%v'", email)
|
|
||||||
} else {
|
|
||||||
return "", "", errors.New("username and email cannot be blank")
|
|
||||||
}
|
|
||||||
|
|
||||||
password := &pw{}
|
password := &pw{}
|
||||||
|
|
||||||
rsp, err := domain.db.Read(ctx, &db.ReadRequest{
|
rsp, err := domain.db.Read(ctx, &db.ReadRequest{
|
||||||
Table: "passwords",
|
Table: "passwords",
|
||||||
Query: query,
|
Query: fmt.Sprintf("id == '%v'", userId),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", "", err
|
return "", "", err
|
||||||
|
|||||||
@@ -16,16 +16,13 @@
|
|||||||
"id": "usrid-1"
|
"id": "usrid-1"
|
||||||
},
|
},
|
||||||
"response": {
|
"response": {
|
||||||
"accounts": [
|
"account": {
|
||||||
{
|
"id": "fdf34f34f34-f34f34-f43f43f34-f4f34f",
|
||||||
"id": "fdf34f34f34-f34f34-f43f43f34-f4f34f",
|
"username": "usrname-1",
|
||||||
"username": "usrname-1",
|
"email": "joe@example.com",
|
||||||
"email": "joe@example.com",
|
"created": "1623677579",
|
||||||
"created": "1623677579",
|
"updated": "1623677579"
|
||||||
"updated": "1623677579"
|
}
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},{
|
},{
|
||||||
"title": "Read account by username or email",
|
"title": "Read account by username or email",
|
||||||
@@ -33,16 +30,13 @@
|
|||||||
"username": "usrname-1"
|
"username": "usrname-1"
|
||||||
},
|
},
|
||||||
"response": {
|
"response": {
|
||||||
"accounts": [
|
"account": {
|
||||||
{
|
"id": "fdf34f34f34-f34f34-f43f43f34-f4f34f",
|
||||||
"id": "fdf34f34f34-f34f34-f43f43f34-f4f34f",
|
"username": "usrname-1",
|
||||||
"username": "usrname-1",
|
"email": "joe@example.com",
|
||||||
"email": "joe@example.com",
|
"created": "1623677579",
|
||||||
"created": "1623677579",
|
"updated": "1623677579"
|
||||||
"updated": "1623677579"
|
}
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},{
|
},{
|
||||||
"title": "Read account by email",
|
"title": "Read account by email",
|
||||||
@@ -50,16 +44,13 @@
|
|||||||
"email": "joe@example.com"
|
"email": "joe@example.com"
|
||||||
},
|
},
|
||||||
"response": {
|
"response": {
|
||||||
"accounts": [
|
"account": {
|
||||||
{
|
"id": "fdf34f34f34-f34f34-f43f43f34-f4f34f",
|
||||||
"id": "fdf34f34f34-f34f34-f43f43f34-f4f34f",
|
"username": "usrname-1",
|
||||||
"username": "usrname-1",
|
"email": "joe@example.com",
|
||||||
"email": "joe@example.com",
|
"created": "1623677579",
|
||||||
"created": "1623677579",
|
"updated": "1623677579"
|
||||||
"updated": "1623677579"
|
}
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package handler
|
|||||||
import (
|
import (
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -49,6 +50,9 @@ func (s *User) Create(ctx context.Context, req *pb.CreateRequest, rsp *pb.Create
|
|||||||
if len(req.Password) < 8 {
|
if len(req.Password) < 8 {
|
||||||
return errors.InternalServerError("user.Create.Check", "Password is less than 8 characters")
|
return errors.InternalServerError("user.Create.Check", "Password is less than 8 characters")
|
||||||
}
|
}
|
||||||
|
req.Username = strings.ToLower(req.Username)
|
||||||
|
req.Email = strings.ToLower(req.Email)
|
||||||
|
|
||||||
salt := random(16)
|
salt := random(16)
|
||||||
h, err := bcrypt.GenerateFromPassword([]byte(x+salt+req.Password), 10)
|
h, err := bcrypt.GenerateFromPassword([]byte(x+salt+req.Password), 10)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -58,11 +62,15 @@ func (s *User) Create(ctx context.Context, req *pb.CreateRequest, rsp *pb.Create
|
|||||||
if req.Id == "" {
|
if req.Id == "" {
|
||||||
req.Id = uuid.New().String()
|
req.Id = uuid.New().String()
|
||||||
}
|
}
|
||||||
return s.domain.Create(ctx, &pb.Account{
|
err = s.domain.Create(ctx, &pb.Account{
|
||||||
Id: req.Id,
|
Id: req.Id,
|
||||||
Username: strings.ToLower(req.Username),
|
Username: req.Username,
|
||||||
Email: strings.ToLower(req.Email),
|
Email: req.Email,
|
||||||
}, salt, pp)
|
}, salt, pp)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *User) Read(ctx context.Context, req *pb.ReadRequest, rsp *pb.ReadResponse) error {
|
func (s *User) Read(ctx context.Context, req *pb.ReadRequest, rsp *pb.ReadResponse) error {
|
||||||
@@ -106,7 +114,7 @@ func (s *User) UpdatePassword(ctx context.Context, req *pb.UpdatePasswordRequest
|
|||||||
return errors.InternalServerError("user.updatepassword", "Passwords don't math")
|
return errors.InternalServerError("user.updatepassword", "Passwords don't math")
|
||||||
}
|
}
|
||||||
|
|
||||||
salt, hashed, err := s.domain.SaltAndPassword(ctx, usr.Username, usr.Email)
|
salt, hashed, err := s.domain.SaltAndPassword(ctx, usr.Id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.InternalServerError("user.updatepassword", err.Error())
|
return errors.InternalServerError("user.updatepassword", err.Error())
|
||||||
}
|
}
|
||||||
@@ -137,7 +145,14 @@ func (s *User) Login(ctx context.Context, req *pb.LoginRequest, rsp *pb.LoginRes
|
|||||||
username := strings.ToLower(req.Username)
|
username := strings.ToLower(req.Username)
|
||||||
email := strings.ToLower(req.Email)
|
email := strings.ToLower(req.Email)
|
||||||
|
|
||||||
salt, hashed, err := s.domain.SaltAndPassword(ctx, username, email)
|
accounts, err := s.domain.Search(ctx, username, email)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if len(accounts) == 0 {
|
||||||
|
return fmt.Errorf("account not found")
|
||||||
|
}
|
||||||
|
salt, hashed, err := s.domain.SaltAndPassword(ctx, accounts[0].Id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -152,11 +167,9 @@ func (s *User) Login(ctx context.Context, req *pb.LoginRequest, rsp *pb.LoginRes
|
|||||||
}
|
}
|
||||||
// save session
|
// save session
|
||||||
sess := &pb.Session{
|
sess := &pb.Session{
|
||||||
Id: random(128),
|
Id: random(128),
|
||||||
Username: username,
|
Created: time.Now().Unix(),
|
||||||
Email: email,
|
Expires: time.Now().Add(time.Hour * 24 * 7).Unix(),
|
||||||
Created: time.Now().Unix(),
|
|
||||||
Expires: time.Now().Add(time.Hour * 24 * 7).Unix(),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := s.domain.CreateSession(ctx, sess); err != nil {
|
if err := s.domain.CreateSession(ctx, sess); err != nil {
|
||||||
@@ -178,3 +191,26 @@ func (s *User) ReadSession(ctx context.Context, req *pb.ReadSessionRequest, rsp
|
|||||||
rsp.Session = sess
|
rsp.Session = sess
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *User) VerifyEmail(ctx context.Context, req *pb.VerifyEmailRequest, rsp *pb.VerifyEmailResponse) error {
|
||||||
|
userId, err := s.domain.ReadToken(ctx, req.Token)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
user, err := s.domain.Read(ctx, userId)
|
||||||
|
user.Verified = true
|
||||||
|
return s.domain.Update(ctx, user)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *User) SendVerificationEmail(ctx context.Context, req *pb.SendVerificationEmailRequest, rsp *pb.SendVerificationEmailResponse) error {
|
||||||
|
users, err := s.domain.Search(ctx, "", req.Email)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
token, err := s.domain.CreateToken(ctx, users[0].Id)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return s.domain.SendEmail(req.FromName, req.Email, users[0].Username, req.Subject, req.TextContent, token, req.RedirectUrl)
|
||||||
|
}
|
||||||
|
|||||||
@@ -13,10 +13,11 @@ func main() {
|
|||||||
service := service.New(
|
service := service.New(
|
||||||
service.Name("user"),
|
service.Name("user"),
|
||||||
)
|
)
|
||||||
|
|
||||||
service.Init()
|
service.Init()
|
||||||
|
|
||||||
proto.RegisterUserHandler(service.Server(), handler.NewUser(db.NewDbService("db", service.Client())))
|
handl := handler.NewUser(db.NewDbService("db", service.Client()))
|
||||||
|
|
||||||
|
proto.RegisterUserHandler(service.Server(), handl)
|
||||||
traceCloser := tracing.SetupOpentracing("user")
|
traceCloser := tracing.SetupOpentracing("user")
|
||||||
defer traceCloser.Close()
|
defer traceCloser.Close()
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,11 @@ type Account struct {
|
|||||||
// unix timestamp
|
// unix timestamp
|
||||||
Created int64 `protobuf:"varint,4,opt,name=created,proto3" json:"created,omitempty"`
|
Created int64 `protobuf:"varint,4,opt,name=created,proto3" json:"created,omitempty"`
|
||||||
// unix timestamp
|
// unix timestamp
|
||||||
Updated int64 `protobuf:"varint,5,opt,name=updated,proto3" json:"updated,omitempty"`
|
Updated int64 `protobuf:"varint,5,opt,name=updated,proto3" json:"updated,omitempty"`
|
||||||
|
Verified bool `protobuf:"varint,6,opt,name=verified,proto3" json:"verified,omitempty"`
|
||||||
|
VerificationDate int64 `protobuf:"varint,7,opt,name=verificationDate,proto3" json:"verificationDate,omitempty"`
|
||||||
|
// Store any custom data you want about your users in this fields.
|
||||||
|
Profile map[string]string `protobuf:"bytes,8,rep,name=profile,proto3" json:"profile,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Account) Reset() {
|
func (x *Account) Reset() {
|
||||||
@@ -104,6 +108,27 @@ func (x *Account) GetUpdated() int64 {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *Account) GetVerified() bool {
|
||||||
|
if x != nil {
|
||||||
|
return x.Verified
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Account) GetVerificationDate() int64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.VerificationDate
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Account) GetProfile() map[string]string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Profile
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
type Session struct {
|
type Session struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
@@ -111,10 +136,6 @@ type Session struct {
|
|||||||
|
|
||||||
// the session id
|
// the session id
|
||||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
// account username
|
|
||||||
Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
|
|
||||||
// account email
|
|
||||||
Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
|
|
||||||
// unix timestamp
|
// unix timestamp
|
||||||
Created int64 `protobuf:"varint,4,opt,name=created,proto3" json:"created,omitempty"`
|
Created int64 `protobuf:"varint,4,opt,name=created,proto3" json:"created,omitempty"`
|
||||||
// unix timestamp
|
// unix timestamp
|
||||||
@@ -160,20 +181,6 @@ func (x *Session) GetId() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Session) GetUsername() string {
|
|
||||||
if x != nil {
|
|
||||||
return x.Username
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *Session) GetEmail() string {
|
|
||||||
if x != nil {
|
|
||||||
return x.Email
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *Session) GetCreated() int64 {
|
func (x *Session) GetCreated() int64 {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Created
|
return x.Created
|
||||||
@@ -268,6 +275,8 @@ type CreateResponse struct {
|
|||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Account *Account `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *CreateResponse) Reset() {
|
func (x *CreateResponse) Reset() {
|
||||||
@@ -302,6 +311,13 @@ func (*CreateResponse) Descriptor() ([]byte, []int) {
|
|||||||
return file_proto_user_proto_rawDescGZIP(), []int{3}
|
return file_proto_user_proto_rawDescGZIP(), []int{3}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *CreateResponse) GetAccount() *Account {
|
||||||
|
if x != nil {
|
||||||
|
return x.Account
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// Delete an account by id
|
// Delete an account by id
|
||||||
type DeleteRequest struct {
|
type DeleteRequest struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
@@ -1012,117 +1028,368 @@ func (*LogoutResponse) Descriptor() ([]byte, []int) {
|
|||||||
return file_proto_user_proto_rawDescGZIP(), []int{17}
|
return file_proto_user_proto_rawDescGZIP(), []int{17}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type VerifyEmailRequest struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *VerifyEmailRequest) Reset() {
|
||||||
|
*x = VerifyEmailRequest{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_proto_user_proto_msgTypes[18]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *VerifyEmailRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*VerifyEmailRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *VerifyEmailRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_proto_user_proto_msgTypes[18]
|
||||||
|
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 VerifyEmailRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*VerifyEmailRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_proto_user_proto_rawDescGZIP(), []int{18}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *VerifyEmailRequest) GetToken() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Token
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
type VerifyEmailResponse struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *VerifyEmailResponse) Reset() {
|
||||||
|
*x = VerifyEmailResponse{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_proto_user_proto_msgTypes[19]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *VerifyEmailResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*VerifyEmailResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *VerifyEmailResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_proto_user_proto_msgTypes[19]
|
||||||
|
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 VerifyEmailResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*VerifyEmailResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_proto_user_proto_rawDescGZIP(), []int{19}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send a verification email
|
||||||
|
// to the user being signed up. Email from will be 'support@m3o.com',
|
||||||
|
// but you can provide the title and contents.
|
||||||
|
// Use $micro_verification_link template variable in the content.
|
||||||
|
type SendVerificationEmailRequest struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`
|
||||||
|
Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"`
|
||||||
|
// Example: 'Hi there, welcome onboard! Use the link below to verify your email: $micro_verification_link'
|
||||||
|
// The variable will be replaced with an actual url that will look similar to this:
|
||||||
|
// 'https://user.m3o.com/user/verify?token=a-verification-token&rediretUrl=your-redir-url'
|
||||||
|
// HTML emails are not available currently.
|
||||||
|
TextContent string `protobuf:"bytes,3,opt,name=textContent,proto3" json:"textContent,omitempty"`
|
||||||
|
RedirectUrl string `protobuf:"bytes,4,opt,name=redirectUrl,proto3" json:"redirectUrl,omitempty"`
|
||||||
|
// While the from email address can't be changed,
|
||||||
|
// the from name (ie. sender name) can.
|
||||||
|
FromName string `protobuf:"bytes,5,opt,name=fromName,proto3" json:"fromName,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SendVerificationEmailRequest) Reset() {
|
||||||
|
*x = SendVerificationEmailRequest{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_proto_user_proto_msgTypes[20]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SendVerificationEmailRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*SendVerificationEmailRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *SendVerificationEmailRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_proto_user_proto_msgTypes[20]
|
||||||
|
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 SendVerificationEmailRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*SendVerificationEmailRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_proto_user_proto_rawDescGZIP(), []int{20}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SendVerificationEmailRequest) GetEmail() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Email
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SendVerificationEmailRequest) GetSubject() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Subject
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SendVerificationEmailRequest) GetTextContent() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.TextContent
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SendVerificationEmailRequest) GetRedirectUrl() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.RedirectUrl
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SendVerificationEmailRequest) GetFromName() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.FromName
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
type SendVerificationEmailResponse struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SendVerificationEmailResponse) Reset() {
|
||||||
|
*x = SendVerificationEmailResponse{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_proto_user_proto_msgTypes[21]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SendVerificationEmailResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*SendVerificationEmailResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *SendVerificationEmailResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_proto_user_proto_msgTypes[21]
|
||||||
|
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 SendVerificationEmailResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*SendVerificationEmailResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_proto_user_proto_rawDescGZIP(), []int{21}
|
||||||
|
}
|
||||||
|
|
||||||
var File_proto_user_proto protoreflect.FileDescriptor
|
var File_proto_user_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
var file_proto_user_proto_rawDesc = []byte{
|
var file_proto_user_proto_rawDesc = []byte{
|
||||||
0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f,
|
0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f,
|
||||||
0x74, 0x6f, 0x12, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x7f, 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f,
|
0x74, 0x6f, 0x12, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0xb9, 0x02, 0x0a, 0x07, 0x41, 0x63, 0x63,
|
||||||
0x75, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
0x6f, 0x75, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||||
0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18,
|
|
||||||
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12,
|
|
||||||
0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
|
|
||||||
0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64,
|
|
||||||
0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12,
|
|
||||||
0x18, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03,
|
|
||||||
0x52, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x22, 0x7f, 0x0a, 0x07, 0x53, 0x65, 0x73,
|
|
||||||
0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
|
||||||
0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65,
|
0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65,
|
||||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65,
|
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65,
|
||||||
0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
|
0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
|
0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
|
||||||
0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64,
|
0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64,
|
||||||
0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28,
|
0x12, 0x18, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28,
|
||||||
0x03, 0x52, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x22, 0x6d, 0x0a, 0x0d, 0x43, 0x72,
|
0x03, 0x52, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x76, 0x65,
|
||||||
0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69,
|
0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x76, 0x65,
|
||||||
|
0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69,
|
||||||
|
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03,
|
||||||
|
0x52, 0x10, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61,
|
||||||
|
0x74, 0x65, 0x12, 0x34, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x08, 0x20,
|
||||||
|
0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75,
|
||||||
|
0x6e, 0x74, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52,
|
||||||
|
0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x1a, 0x3a, 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x66,
|
||||||
|
0x69, 0x6c, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
|
||||||
|
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61,
|
||||||
|
0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
|
||||||
|
0x3a, 0x02, 0x38, 0x01, 0x22, 0x4d, 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12,
|
||||||
|
0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12,
|
||||||
|
0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03,
|
||||||
|
0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x70,
|
||||||
|
0x69, 0x72, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x78, 0x70, 0x69,
|
||||||
|
0x72, 0x65, 0x73, 0x22, 0x6d, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71,
|
||||||
|
0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||||
|
0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65,
|
||||||
|
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65,
|
||||||
|
0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
|
0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 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, 0x22, 0x39, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70,
|
||||||
|
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18,
|
||||||
|
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x41, 0x63, 0x63,
|
||||||
|
0x6f, 0x75, 0x6e, 0x74, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x1f, 0x0a,
|
||||||
|
0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e,
|
||||||
|
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x10,
|
||||||
|
0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||||
|
0x22, 0x4f, 0x0a, 0x0b, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
|
||||||
|
0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12,
|
||||||
|
0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||||
|
0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65,
|
||||||
|
0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69,
|
||||||
|
0x6c, 0x22, 0x37, 0x0a, 0x0c, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||||
|
0x65, 0x12, 0x27, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01,
|
||||||
|
0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e,
|
||||||
|
0x74, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x51, 0x0a, 0x0d, 0x55, 0x70,
|
||||||
|
0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69,
|
||||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75,
|
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75,
|
||||||
0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75,
|
0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75,
|
||||||
0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c,
|
0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c,
|
||||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a,
|
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0x10, 0x0a,
|
||||||
0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
|
0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
||||||
0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x43, 0x72, 0x65,
|
0x9e, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f,
|
||||||
0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x0a, 0x0d, 0x44,
|
0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65,
|
||||||
0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02,
|
0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49,
|
||||||
0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x10, 0x0a, 0x0e,
|
0x64, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x6c, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64,
|
||||||
0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4f,
|
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x6c, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77,
|
||||||
0x0a, 0x0b, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a,
|
0x6f, 0x72, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x6e, 0x65, 0x77, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f,
|
||||||
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a,
|
0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x65, 0x77, 0x50, 0x61, 0x73,
|
||||||
0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d,
|
||||||
0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61,
|
0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x22,
|
0x0f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64,
|
||||||
0x37, 0x0a, 0x0c, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
|
0x22, 0x18, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f,
|
||||||
0x27, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
|
0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x0a, 0x12, 0x52, 0x65,
|
||||||
0x32, 0x0d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52,
|
0x61, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||||
0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x51, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61,
|
0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20,
|
||||||
0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
|
0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x3e,
|
||||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65,
|
0x0a, 0x13, 0x52, 0x65, 0x61, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73,
|
||||||
0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65,
|
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e,
|
||||||
0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03,
|
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x53, 0x65,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0x10, 0x0a, 0x0e, 0x55,
|
0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5c,
|
||||||
0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9e, 0x01,
|
0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a,
|
||||||
0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64,
|
0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49,
|
0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d,
|
||||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12,
|
0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c,
|
||||||
0x20, 0x0a, 0x0b, 0x6f, 0x6c, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02,
|
0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x6c, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72,
|
0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x38, 0x0a, 0x0d,
|
||||||
0x64, 0x12, 0x20, 0x0a, 0x0b, 0x6e, 0x65, 0x77, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64,
|
0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a,
|
||||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x65, 0x77, 0x50, 0x61, 0x73, 0x73, 0x77,
|
0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d,
|
||||||
0x6f, 0x72, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x5f, 0x70,
|
0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x73,
|
||||||
0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63,
|
0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x2d, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74,
|
||||||
0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x18,
|
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69,
|
||||||
0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64,
|
0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73,
|
||||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x0a, 0x12, 0x52, 0x65, 0x61, 0x64,
|
0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52,
|
||||||
0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c,
|
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x0a, 0x12, 0x56, 0x65, 0x72, 0x69, 0x66,
|
||||||
0x0a, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
|
0x79, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a,
|
||||||
0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x3e, 0x0a, 0x13,
|
0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f,
|
||||||
0x52, 0x65, 0x61, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
0x6b, 0x65, 0x6e, 0x22, 0x15, 0x0a, 0x13, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x45, 0x6d, 0x61,
|
||||||
0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01,
|
0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xae, 0x01, 0x0a, 0x1c, 0x53,
|
||||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x73, 0x73,
|
0x65, 0x6e, 0x64, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45,
|
||||||
0x69, 0x6f, 0x6e, 0x52, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5c, 0x0a, 0x0c,
|
0x6d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65,
|
||||||
0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08,
|
0x6d, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69,
|
||||||
0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
|
0x6c, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01,
|
||||||
0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69,
|
0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x74,
|
||||||
0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a,
|
0x65, 0x78, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
|
||||||
0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
|
0x52, 0x0b, 0x74, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x20, 0x0a,
|
||||||
0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x38, 0x0a, 0x0d, 0x4c, 0x6f,
|
0x0b, 0x72, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x55, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01,
|
||||||
0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x07, 0x73,
|
0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x55, 0x72, 0x6c, 0x12,
|
||||||
0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x75,
|
0x1a, 0x0a, 0x08, 0x66, 0x72, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28,
|
||||||
0x73, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x73, 0x65, 0x73,
|
0x09, 0x52, 0x08, 0x66, 0x72, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x1f, 0x0a, 0x1d, 0x53,
|
||||||
0x73, 0x69, 0x6f, 0x6e, 0x22, 0x2d, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65,
|
0x65, 0x6e, 0x64, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45,
|
||||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e,
|
0x6d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x86, 0x05, 0x0a,
|
||||||
0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f,
|
0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x35, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12,
|
||||||
0x6e, 0x49, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x73,
|
0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71,
|
||||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xdc, 0x03, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x35,
|
0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61,
|
||||||
0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e,
|
0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x2f, 0x0a, 0x04,
|
||||||
0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e,
|
0x52, 0x65, 0x61, 0x64, 0x12, 0x11, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x61, 0x64,
|
||||||
0x75, 0x73, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x52,
|
||||||
0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x2f, 0x0a, 0x04, 0x52, 0x65, 0x61, 0x64, 0x12, 0x11, 0x2e,
|
0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x35, 0x0a,
|
||||||
0x75, 0x73, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55,
|
||||||
0x1a, 0x12, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70,
|
0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x75,
|
||||||
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x35, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
|
0x73, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||||
0x12, 0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65,
|
0x73, 0x65, 0x22, 0x00, 0x12, 0x35, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x13,
|
||||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64,
|
0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75,
|
||||||
0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x35, 0x0a,
|
0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74,
|
||||||
0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x44,
|
0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0e, 0x55,
|
||||||
0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x75,
|
0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1b, 0x2e,
|
||||||
0x73, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77,
|
||||||
0x73, 0x65, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61,
|
0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x75, 0x73, 0x65,
|
||||||
0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1b, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x70,
|
0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64,
|
||||||
0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75,
|
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x32, 0x0a, 0x05, 0x4c, 0x6f,
|
||||||
0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74,
|
0x67, 0x69, 0x6e, 0x12, 0x12, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e,
|
||||||
0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x4c,
|
||||||
0x65, 0x22, 0x00, 0x12, 0x32, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x12, 0x2e, 0x75,
|
0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x35,
|
||||||
0x73, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
0x0a, 0x06, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12, 0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e,
|
||||||
0x1a, 0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73,
|
0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e,
|
||||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x35, 0x0a, 0x06, 0x4c, 0x6f, 0x67, 0x6f, 0x75,
|
0x75, 0x73, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||||
0x74, 0x12, 0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52,
|
0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x0b, 0x52, 0x65, 0x61, 0x64, 0x53, 0x65, 0x73,
|
||||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x4c, 0x6f,
|
0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x61, 0x64,
|
||||||
0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x44,
|
0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19,
|
||||||
0x0a, 0x0b, 0x52, 0x65, 0x61, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x2e,
|
0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f,
|
||||||
0x75, 0x73, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e,
|
0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x0b, 0x56,
|
||||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x52,
|
0x65, 0x72, 0x69, 0x66, 0x79, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x18, 0x2e, 0x75, 0x73, 0x65,
|
||||||
0x65, 0x61, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
0x72, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71,
|
||||||
0x73, 0x65, 0x22, 0x00, 0x42, 0x0e, 0x5a, 0x0c, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b,
|
0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x56, 0x65, 0x72, 0x69,
|
||||||
0x75, 0x73, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x66, 0x79, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
||||||
|
0x00, 0x12, 0x62, 0x0a, 0x15, 0x53, 0x65, 0x6e, 0x64, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63,
|
||||||
|
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x22, 0x2e, 0x75, 0x73, 0x65,
|
||||||
|
0x72, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69,
|
||||||
|
0x6f, 0x6e, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23,
|
||||||
|
0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69,
|
||||||
|
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||||
|
0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x0e, 0x5a, 0x0c, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
|
0x3b, 0x75, 0x73, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -1137,52 +1404,63 @@ func file_proto_user_proto_rawDescGZIP() []byte {
|
|||||||
return file_proto_user_proto_rawDescData
|
return file_proto_user_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_proto_user_proto_msgTypes = make([]protoimpl.MessageInfo, 18)
|
var file_proto_user_proto_msgTypes = make([]protoimpl.MessageInfo, 23)
|
||||||
var file_proto_user_proto_goTypes = []interface{}{
|
var file_proto_user_proto_goTypes = []interface{}{
|
||||||
(*Account)(nil), // 0: user.Account
|
(*Account)(nil), // 0: user.Account
|
||||||
(*Session)(nil), // 1: user.Session
|
(*Session)(nil), // 1: user.Session
|
||||||
(*CreateRequest)(nil), // 2: user.CreateRequest
|
(*CreateRequest)(nil), // 2: user.CreateRequest
|
||||||
(*CreateResponse)(nil), // 3: user.CreateResponse
|
(*CreateResponse)(nil), // 3: user.CreateResponse
|
||||||
(*DeleteRequest)(nil), // 4: user.DeleteRequest
|
(*DeleteRequest)(nil), // 4: user.DeleteRequest
|
||||||
(*DeleteResponse)(nil), // 5: user.DeleteResponse
|
(*DeleteResponse)(nil), // 5: user.DeleteResponse
|
||||||
(*ReadRequest)(nil), // 6: user.ReadRequest
|
(*ReadRequest)(nil), // 6: user.ReadRequest
|
||||||
(*ReadResponse)(nil), // 7: user.ReadResponse
|
(*ReadResponse)(nil), // 7: user.ReadResponse
|
||||||
(*UpdateRequest)(nil), // 8: user.UpdateRequest
|
(*UpdateRequest)(nil), // 8: user.UpdateRequest
|
||||||
(*UpdateResponse)(nil), // 9: user.UpdateResponse
|
(*UpdateResponse)(nil), // 9: user.UpdateResponse
|
||||||
(*UpdatePasswordRequest)(nil), // 10: user.UpdatePasswordRequest
|
(*UpdatePasswordRequest)(nil), // 10: user.UpdatePasswordRequest
|
||||||
(*UpdatePasswordResponse)(nil), // 11: user.UpdatePasswordResponse
|
(*UpdatePasswordResponse)(nil), // 11: user.UpdatePasswordResponse
|
||||||
(*ReadSessionRequest)(nil), // 12: user.ReadSessionRequest
|
(*ReadSessionRequest)(nil), // 12: user.ReadSessionRequest
|
||||||
(*ReadSessionResponse)(nil), // 13: user.ReadSessionResponse
|
(*ReadSessionResponse)(nil), // 13: user.ReadSessionResponse
|
||||||
(*LoginRequest)(nil), // 14: user.LoginRequest
|
(*LoginRequest)(nil), // 14: user.LoginRequest
|
||||||
(*LoginResponse)(nil), // 15: user.LoginResponse
|
(*LoginResponse)(nil), // 15: user.LoginResponse
|
||||||
(*LogoutRequest)(nil), // 16: user.LogoutRequest
|
(*LogoutRequest)(nil), // 16: user.LogoutRequest
|
||||||
(*LogoutResponse)(nil), // 17: user.LogoutResponse
|
(*LogoutResponse)(nil), // 17: user.LogoutResponse
|
||||||
|
(*VerifyEmailRequest)(nil), // 18: user.VerifyEmailRequest
|
||||||
|
(*VerifyEmailResponse)(nil), // 19: user.VerifyEmailResponse
|
||||||
|
(*SendVerificationEmailRequest)(nil), // 20: user.SendVerificationEmailRequest
|
||||||
|
(*SendVerificationEmailResponse)(nil), // 21: user.SendVerificationEmailResponse
|
||||||
|
nil, // 22: user.Account.ProfileEntry
|
||||||
}
|
}
|
||||||
var file_proto_user_proto_depIdxs = []int32{
|
var file_proto_user_proto_depIdxs = []int32{
|
||||||
0, // 0: user.ReadResponse.account:type_name -> user.Account
|
22, // 0: user.Account.profile:type_name -> user.Account.ProfileEntry
|
||||||
1, // 1: user.ReadSessionResponse.session:type_name -> user.Session
|
0, // 1: user.CreateResponse.account:type_name -> user.Account
|
||||||
1, // 2: user.LoginResponse.session:type_name -> user.Session
|
0, // 2: user.ReadResponse.account:type_name -> user.Account
|
||||||
2, // 3: user.User.Create:input_type -> user.CreateRequest
|
1, // 3: user.ReadSessionResponse.session:type_name -> user.Session
|
||||||
6, // 4: user.User.Read:input_type -> user.ReadRequest
|
1, // 4: user.LoginResponse.session:type_name -> user.Session
|
||||||
8, // 5: user.User.Update:input_type -> user.UpdateRequest
|
2, // 5: user.User.Create:input_type -> user.CreateRequest
|
||||||
4, // 6: user.User.Delete:input_type -> user.DeleteRequest
|
6, // 6: user.User.Read:input_type -> user.ReadRequest
|
||||||
10, // 7: user.User.UpdatePassword:input_type -> user.UpdatePasswordRequest
|
8, // 7: user.User.Update:input_type -> user.UpdateRequest
|
||||||
14, // 8: user.User.Login:input_type -> user.LoginRequest
|
4, // 8: user.User.Delete:input_type -> user.DeleteRequest
|
||||||
16, // 9: user.User.Logout:input_type -> user.LogoutRequest
|
10, // 9: user.User.UpdatePassword:input_type -> user.UpdatePasswordRequest
|
||||||
12, // 10: user.User.ReadSession:input_type -> user.ReadSessionRequest
|
14, // 10: user.User.Login:input_type -> user.LoginRequest
|
||||||
3, // 11: user.User.Create:output_type -> user.CreateResponse
|
16, // 11: user.User.Logout:input_type -> user.LogoutRequest
|
||||||
7, // 12: user.User.Read:output_type -> user.ReadResponse
|
12, // 12: user.User.ReadSession:input_type -> user.ReadSessionRequest
|
||||||
9, // 13: user.User.Update:output_type -> user.UpdateResponse
|
18, // 13: user.User.VerifyEmail:input_type -> user.VerifyEmailRequest
|
||||||
5, // 14: user.User.Delete:output_type -> user.DeleteResponse
|
20, // 14: user.User.SendVerificationEmail:input_type -> user.SendVerificationEmailRequest
|
||||||
11, // 15: user.User.UpdatePassword:output_type -> user.UpdatePasswordResponse
|
3, // 15: user.User.Create:output_type -> user.CreateResponse
|
||||||
15, // 16: user.User.Login:output_type -> user.LoginResponse
|
7, // 16: user.User.Read:output_type -> user.ReadResponse
|
||||||
17, // 17: user.User.Logout:output_type -> user.LogoutResponse
|
9, // 17: user.User.Update:output_type -> user.UpdateResponse
|
||||||
13, // 18: user.User.ReadSession:output_type -> user.ReadSessionResponse
|
5, // 18: user.User.Delete:output_type -> user.DeleteResponse
|
||||||
11, // [11:19] is the sub-list for method output_type
|
11, // 19: user.User.UpdatePassword:output_type -> user.UpdatePasswordResponse
|
||||||
3, // [3:11] is the sub-list for method input_type
|
15, // 20: user.User.Login:output_type -> user.LoginResponse
|
||||||
3, // [3:3] is the sub-list for extension type_name
|
17, // 21: user.User.Logout:output_type -> user.LogoutResponse
|
||||||
3, // [3:3] is the sub-list for extension extendee
|
13, // 22: user.User.ReadSession:output_type -> user.ReadSessionResponse
|
||||||
0, // [0:3] is the sub-list for field type_name
|
19, // 23: user.User.VerifyEmail:output_type -> user.VerifyEmailResponse
|
||||||
|
21, // 24: user.User.SendVerificationEmail:output_type -> user.SendVerificationEmailResponse
|
||||||
|
15, // [15:25] is the sub-list for method output_type
|
||||||
|
5, // [5:15] is the sub-list for method input_type
|
||||||
|
5, // [5:5] is the sub-list for extension type_name
|
||||||
|
5, // [5:5] is the sub-list for extension extendee
|
||||||
|
0, // [0:5] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_proto_user_proto_init() }
|
func init() { file_proto_user_proto_init() }
|
||||||
@@ -1407,6 +1685,54 @@ func file_proto_user_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
file_proto_user_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*VerifyEmailRequest); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_proto_user_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*VerifyEmailResponse); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_proto_user_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*SendVerificationEmailRequest); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_proto_user_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*SendVerificationEmailResponse); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
type x struct{}
|
type x struct{}
|
||||||
out := protoimpl.TypeBuilder{
|
out := protoimpl.TypeBuilder{
|
||||||
@@ -1414,7 +1740,7 @@ func file_proto_user_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_proto_user_proto_rawDesc,
|
RawDescriptor: file_proto_user_proto_rawDesc,
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 18,
|
NumMessages: 23,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 1,
|
NumServices: 1,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -50,6 +50,8 @@ type UserService interface {
|
|||||||
Login(ctx context.Context, in *LoginRequest, opts ...client.CallOption) (*LoginResponse, error)
|
Login(ctx context.Context, in *LoginRequest, opts ...client.CallOption) (*LoginResponse, error)
|
||||||
Logout(ctx context.Context, in *LogoutRequest, opts ...client.CallOption) (*LogoutResponse, error)
|
Logout(ctx context.Context, in *LogoutRequest, opts ...client.CallOption) (*LogoutResponse, error)
|
||||||
ReadSession(ctx context.Context, in *ReadSessionRequest, opts ...client.CallOption) (*ReadSessionResponse, error)
|
ReadSession(ctx context.Context, in *ReadSessionRequest, opts ...client.CallOption) (*ReadSessionResponse, error)
|
||||||
|
VerifyEmail(ctx context.Context, in *VerifyEmailRequest, opts ...client.CallOption) (*VerifyEmailResponse, error)
|
||||||
|
SendVerificationEmail(ctx context.Context, in *SendVerificationEmailRequest, opts ...client.CallOption) (*SendVerificationEmailResponse, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type userService struct {
|
type userService struct {
|
||||||
@@ -144,6 +146,26 @@ func (c *userService) ReadSession(ctx context.Context, in *ReadSessionRequest, o
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *userService) VerifyEmail(ctx context.Context, in *VerifyEmailRequest, opts ...client.CallOption) (*VerifyEmailResponse, error) {
|
||||||
|
req := c.c.NewRequest(c.name, "User.VerifyEmail", in)
|
||||||
|
out := new(VerifyEmailResponse)
|
||||||
|
err := c.c.Call(ctx, req, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *userService) SendVerificationEmail(ctx context.Context, in *SendVerificationEmailRequest, opts ...client.CallOption) (*SendVerificationEmailResponse, error) {
|
||||||
|
req := c.c.NewRequest(c.name, "User.SendVerificationEmail", in)
|
||||||
|
out := new(SendVerificationEmailResponse)
|
||||||
|
err := c.c.Call(ctx, req, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
// Server API for User service
|
// Server API for User service
|
||||||
|
|
||||||
type UserHandler interface {
|
type UserHandler interface {
|
||||||
@@ -155,6 +177,8 @@ type UserHandler interface {
|
|||||||
Login(context.Context, *LoginRequest, *LoginResponse) error
|
Login(context.Context, *LoginRequest, *LoginResponse) error
|
||||||
Logout(context.Context, *LogoutRequest, *LogoutResponse) error
|
Logout(context.Context, *LogoutRequest, *LogoutResponse) error
|
||||||
ReadSession(context.Context, *ReadSessionRequest, *ReadSessionResponse) error
|
ReadSession(context.Context, *ReadSessionRequest, *ReadSessionResponse) error
|
||||||
|
VerifyEmail(context.Context, *VerifyEmailRequest, *VerifyEmailResponse) error
|
||||||
|
SendVerificationEmail(context.Context, *SendVerificationEmailRequest, *SendVerificationEmailResponse) error
|
||||||
}
|
}
|
||||||
|
|
||||||
func RegisterUserHandler(s server.Server, hdlr UserHandler, opts ...server.HandlerOption) error {
|
func RegisterUserHandler(s server.Server, hdlr UserHandler, opts ...server.HandlerOption) error {
|
||||||
@@ -167,6 +191,8 @@ func RegisterUserHandler(s server.Server, hdlr UserHandler, opts ...server.Handl
|
|||||||
Login(ctx context.Context, in *LoginRequest, out *LoginResponse) error
|
Login(ctx context.Context, in *LoginRequest, out *LoginResponse) error
|
||||||
Logout(ctx context.Context, in *LogoutRequest, out *LogoutResponse) error
|
Logout(ctx context.Context, in *LogoutRequest, out *LogoutResponse) error
|
||||||
ReadSession(ctx context.Context, in *ReadSessionRequest, out *ReadSessionResponse) error
|
ReadSession(ctx context.Context, in *ReadSessionRequest, out *ReadSessionResponse) error
|
||||||
|
VerifyEmail(ctx context.Context, in *VerifyEmailRequest, out *VerifyEmailResponse) error
|
||||||
|
SendVerificationEmail(ctx context.Context, in *SendVerificationEmailRequest, out *SendVerificationEmailResponse) error
|
||||||
}
|
}
|
||||||
type User struct {
|
type User struct {
|
||||||
user
|
user
|
||||||
@@ -210,3 +236,11 @@ func (h *userHandler) Logout(ctx context.Context, in *LogoutRequest, out *Logout
|
|||||||
func (h *userHandler) ReadSession(ctx context.Context, in *ReadSessionRequest, out *ReadSessionResponse) error {
|
func (h *userHandler) ReadSession(ctx context.Context, in *ReadSessionRequest, out *ReadSessionResponse) error {
|
||||||
return h.UserHandler.ReadSession(ctx, in, out)
|
return h.UserHandler.ReadSession(ctx, in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (h *userHandler) VerifyEmail(ctx context.Context, in *VerifyEmailRequest, out *VerifyEmailResponse) error {
|
||||||
|
return h.UserHandler.VerifyEmail(ctx, in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h *userHandler) SendVerificationEmail(ctx context.Context, in *SendVerificationEmailRequest, out *SendVerificationEmailResponse) error {
|
||||||
|
return h.UserHandler.SendVerificationEmail(ctx, in, out)
|
||||||
|
}
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ service User {
|
|||||||
rpc Login(LoginRequest) returns (LoginResponse) {}
|
rpc Login(LoginRequest) returns (LoginResponse) {}
|
||||||
rpc Logout(LogoutRequest) returns (LogoutResponse) {}
|
rpc Logout(LogoutRequest) returns (LogoutResponse) {}
|
||||||
rpc ReadSession(ReadSessionRequest) returns(ReadSessionResponse) {}
|
rpc ReadSession(ReadSessionRequest) returns(ReadSessionResponse) {}
|
||||||
|
rpc VerifyEmail(VerifyEmailRequest) returns(VerifyEmailResponse) {}
|
||||||
|
rpc SendVerificationEmail(SendVerificationEmailRequest) returns (SendVerificationEmailResponse) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
message Account {
|
message Account {
|
||||||
@@ -26,15 +28,15 @@ message Account {
|
|||||||
int64 created = 4;
|
int64 created = 4;
|
||||||
// unix timestamp
|
// unix timestamp
|
||||||
int64 updated = 5;
|
int64 updated = 5;
|
||||||
|
bool verified = 6;
|
||||||
|
int64 verificationDate = 7;
|
||||||
|
// Store any custom data you want about your users in this fields.
|
||||||
|
map<string,string> profile = 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Session {
|
message Session {
|
||||||
// the session id
|
// the session id
|
||||||
string id = 1;
|
string id = 1;
|
||||||
// account username
|
|
||||||
string username = 2;
|
|
||||||
// account email
|
|
||||||
string email = 3;
|
|
||||||
// unix timestamp
|
// unix timestamp
|
||||||
int64 created = 4;
|
int64 created = 4;
|
||||||
// unix timestamp
|
// unix timestamp
|
||||||
@@ -54,6 +56,7 @@ message CreateRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message CreateResponse {
|
message CreateResponse {
|
||||||
|
Account account = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete an account by id
|
// Delete an account by id
|
||||||
@@ -134,3 +137,30 @@ message LogoutRequest {
|
|||||||
message LogoutResponse {
|
message LogoutResponse {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message VerifyEmailRequest{
|
||||||
|
string token = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message VerifyEmailResponse{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send a verification email
|
||||||
|
// to the user being signed up. Email from will be 'support@m3o.com',
|
||||||
|
// but you can provide the title and contents.
|
||||||
|
// Use $micro_verification_link template variable in the content.
|
||||||
|
message SendVerificationEmailRequest{
|
||||||
|
string email = 1;
|
||||||
|
string subject = 2;
|
||||||
|
// Example: 'Hi there, welcome onboard! Use the link below to verify your email: $micro_verification_link'
|
||||||
|
// The variable will be replaced with an actual url that will look similar to this:
|
||||||
|
// 'https://user.m3o.com/user/verify?token=a-verification-token&rediretUrl=your-redir-url'
|
||||||
|
// HTML emails are not available currently.
|
||||||
|
string textContent = 3;
|
||||||
|
string redirectUrl = 4;
|
||||||
|
// While the from email address can't be changed,
|
||||||
|
// the from name (ie. sender name) can.
|
||||||
|
string fromName = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
message SendVerificationEmailResponse{}
|
||||||
Reference in New Issue
Block a user