fix merge conflicts
This commit is contained in:
+916
-414
File diff suppressed because it is too large
Load Diff
@@ -1,17 +1,18 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: pkg/proto/v0/accounts.proto
|
||||
// source: accounts.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
empty "github.com/golang/protobuf/ptypes/empty"
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
math "math"
|
||||
)
|
||||
|
||||
import (
|
||||
context "context"
|
||||
api "github.com/micro/go-micro/v2/api"
|
||||
client "github.com/micro/go-micro/v2/client"
|
||||
server "github.com/micro/go-micro/v2/server"
|
||||
)
|
||||
@@ -28,32 +29,39 @@ var _ = math.Inf
|
||||
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ api.Endpoint
|
||||
var _ context.Context
|
||||
var _ client.Option
|
||||
var _ server.Option
|
||||
|
||||
// Client API for SettingsService service
|
||||
// Api Endpoints for AccountsService service
|
||||
|
||||
type SettingsService interface {
|
||||
Set(ctx context.Context, in *Record, opts ...client.CallOption) (*Record, error)
|
||||
Get(ctx context.Context, in *Query, opts ...client.CallOption) (*Record, error)
|
||||
List(ctx context.Context, in *empty.Empty, opts ...client.CallOption) (*Records, error)
|
||||
func NewAccountsServiceEndpoints() []*api.Endpoint {
|
||||
return []*api.Endpoint{}
|
||||
}
|
||||
|
||||
type settingsService struct {
|
||||
// Client API for AccountsService service
|
||||
|
||||
type AccountsService interface {
|
||||
Set(ctx context.Context, in *Record, opts ...client.CallOption) (*Record, error)
|
||||
Get(ctx context.Context, in *GetRequest, opts ...client.CallOption) (*Record, error)
|
||||
Search(ctx context.Context, in *Query, opts ...client.CallOption) (*Records, error)
|
||||
}
|
||||
|
||||
type accountsService struct {
|
||||
c client.Client
|
||||
name string
|
||||
}
|
||||
|
||||
func NewSettingsService(name string, c client.Client) SettingsService {
|
||||
return &settingsService{
|
||||
func NewAccountsService(name string, c client.Client) AccountsService {
|
||||
return &accountsService{
|
||||
c: c,
|
||||
name: name,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *settingsService) Set(ctx context.Context, in *Record, opts ...client.CallOption) (*Record, error) {
|
||||
req := c.c.NewRequest(c.name, "SettingsService.Set", in)
|
||||
func (c *accountsService) Set(ctx context.Context, in *Record, opts ...client.CallOption) (*Record, error) {
|
||||
req := c.c.NewRequest(c.name, "AccountsService.Set", in)
|
||||
out := new(Record)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
@@ -62,8 +70,8 @@ func (c *settingsService) Set(ctx context.Context, in *Record, opts ...client.Ca
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *settingsService) Get(ctx context.Context, in *Query, opts ...client.CallOption) (*Record, error) {
|
||||
req := c.c.NewRequest(c.name, "SettingsService.Get", in)
|
||||
func (c *accountsService) Get(ctx context.Context, in *GetRequest, opts ...client.CallOption) (*Record, error) {
|
||||
req := c.c.NewRequest(c.name, "AccountsService.Get", in)
|
||||
out := new(Record)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
@@ -72,8 +80,8 @@ func (c *settingsService) Get(ctx context.Context, in *Query, opts ...client.Cal
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *settingsService) List(ctx context.Context, in *empty.Empty, opts ...client.CallOption) (*Records, error) {
|
||||
req := c.c.NewRequest(c.name, "SettingsService.List", in)
|
||||
func (c *accountsService) Search(ctx context.Context, in *Query, opts ...client.CallOption) (*Records, error) {
|
||||
req := c.c.NewRequest(c.name, "AccountsService.Search", in)
|
||||
out := new(Records)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
@@ -82,39 +90,39 @@ func (c *settingsService) List(ctx context.Context, in *empty.Empty, opts ...cli
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for SettingsService service
|
||||
// Server API for AccountsService service
|
||||
|
||||
type SettingsServiceHandler interface {
|
||||
type AccountsServiceHandler interface {
|
||||
Set(context.Context, *Record, *Record) error
|
||||
Get(context.Context, *Query, *Record) error
|
||||
List(context.Context, *empty.Empty, *Records) error
|
||||
Get(context.Context, *GetRequest, *Record) error
|
||||
Search(context.Context, *Query, *Records) error
|
||||
}
|
||||
|
||||
func RegisterSettingsServiceHandler(s server.Server, hdlr SettingsServiceHandler, opts ...server.HandlerOption) error {
|
||||
type settingsService interface {
|
||||
func RegisterAccountsServiceHandler(s server.Server, hdlr AccountsServiceHandler, opts ...server.HandlerOption) error {
|
||||
type accountsService interface {
|
||||
Set(ctx context.Context, in *Record, out *Record) error
|
||||
Get(ctx context.Context, in *Query, out *Record) error
|
||||
List(ctx context.Context, in *empty.Empty, out *Records) error
|
||||
Get(ctx context.Context, in *GetRequest, out *Record) error
|
||||
Search(ctx context.Context, in *Query, out *Records) error
|
||||
}
|
||||
type SettingsService struct {
|
||||
settingsService
|
||||
type AccountsService struct {
|
||||
accountsService
|
||||
}
|
||||
h := &settingsServiceHandler{hdlr}
|
||||
return s.Handle(s.NewHandler(&SettingsService{h}, opts...))
|
||||
h := &accountsServiceHandler{hdlr}
|
||||
return s.Handle(s.NewHandler(&AccountsService{h}, opts...))
|
||||
}
|
||||
|
||||
type settingsServiceHandler struct {
|
||||
SettingsServiceHandler
|
||||
type accountsServiceHandler struct {
|
||||
AccountsServiceHandler
|
||||
}
|
||||
|
||||
func (h *settingsServiceHandler) Set(ctx context.Context, in *Record, out *Record) error {
|
||||
return h.SettingsServiceHandler.Set(ctx, in, out)
|
||||
func (h *accountsServiceHandler) Set(ctx context.Context, in *Record, out *Record) error {
|
||||
return h.AccountsServiceHandler.Set(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *settingsServiceHandler) Get(ctx context.Context, in *Query, out *Record) error {
|
||||
return h.SettingsServiceHandler.Get(ctx, in, out)
|
||||
func (h *accountsServiceHandler) Get(ctx context.Context, in *GetRequest, out *Record) error {
|
||||
return h.AccountsServiceHandler.Get(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *settingsServiceHandler) List(ctx context.Context, in *empty.Empty, out *Records) error {
|
||||
return h.SettingsServiceHandler.List(ctx, in, out)
|
||||
func (h *accountsServiceHandler) Search(ctx context.Context, in *Query, out *Records) error {
|
||||
return h.AccountsServiceHandler.Search(ctx, in, out)
|
||||
}
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package settings;
|
||||
option go_package = "proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
option go_package = "pkg/proto/v0;proto";
|
||||
|
||||
service SettingsService {
|
||||
package settings;
|
||||
|
||||
import "google/api/field_behavior.proto";
|
||||
|
||||
service AccountsService {
|
||||
rpc Set(Record) returns (Record);
|
||||
rpc Get(Query) returns (Record);
|
||||
rpc List(google.protobuf.Empty) returns(Records);
|
||||
rpc Get(GetRequest) returns (Record);
|
||||
rpc Search(Query) returns (Records);
|
||||
}
|
||||
|
||||
message Record {
|
||||
@@ -63,10 +65,64 @@ message IdHistory {
|
||||
string iss = 2;
|
||||
}
|
||||
|
||||
message Phoenix {
|
||||
string theme = 1;
|
||||
}
|
||||
|
||||
// Used to fetch exactly one user. The conditions are optional. If set, all have to be true.
|
||||
message GetRequest {
|
||||
// Used to look up user by the oidc sub and iss
|
||||
IdHistory identity = 1;
|
||||
|
||||
// Used to look up the user by our internal uuid
|
||||
string uuid = 2;
|
||||
|
||||
// Used to authenticate users using basic auth
|
||||
string username = 3;
|
||||
string password = 4;
|
||||
|
||||
// Used as a fallback mechanism in case sub or iss changed for an existing user
|
||||
string email = 5;
|
||||
}
|
||||
|
||||
message Query {
|
||||
string key = 1;
|
||||
// Optional. The maximum number of accounts to return in the response.
|
||||
int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL];
|
||||
|
||||
// Optional. A pagination token returned from a previous call to `Get`
|
||||
// that indicates from where search should continue.
|
||||
string page_token = 2 [(google.api.field_behavior) = OPTIONAL];
|
||||
|
||||
// Search criteria used to select the Accounts to return.
|
||||
// If no search criteria is specified then all accounts will be
|
||||
// returned.
|
||||
//
|
||||
// Query expressions can be used to restrict results based upon the standard claims,
|
||||
// iss, and uuid where the operators `=`, `NOT`, `AND` and `OR`
|
||||
// can be used along with the suffix wildcard symbol `*`.
|
||||
//
|
||||
// The *_name claims in a query expression should use escaped quotes
|
||||
// for values that include whitespace to prevent unexpected behavior.
|
||||
//
|
||||
// Some example queries are:
|
||||
//
|
||||
// * Query `name=Th*` returns accounts whose name claim
|
||||
// starts with "Th".
|
||||
// * Query `email=foo@example.com` returns accounts with
|
||||
// `email` set to `foo@example.com`.
|
||||
// * Query `address/country=de` returns accounts that have
|
||||
// an address in Germany
|
||||
// * Query `name=\\"Test String\\"` returns accounts with
|
||||
// display names that include both "Test" and "String".
|
||||
string query = 3;
|
||||
}
|
||||
|
||||
message Records {
|
||||
// A possibly paginated accounts search result for
|
||||
// the specified query.
|
||||
repeated Record records = 1;
|
||||
|
||||
// A pagination token returned from a previous call to `Search`
|
||||
// that indicates from where searching should continue.
|
||||
string next_page_token = 2;
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
checks = ["all", "-ST1003", "-ST1000", "-SA1019"]
|
||||
Reference in New Issue
Block a user