diff --git a/build/deploy/hermes/docker-compose.yml b/build/deploy/hermes/docker-compose.yml index 9249f0ee..01871cfc 100644 --- a/build/deploy/hermes/docker-compose.yml +++ b/build/deploy/hermes/docker-compose.yml @@ -1,7 +1,7 @@ version: "3" services: hermes-api: - image: ghcr.io/ownmfa/hermes:d7dbe626 + image: ghcr.io/ownmfa/hermes:2298e54d command: hermes-api restart: on-failure depends_on: @@ -36,7 +36,7 @@ services: - "traefik.http.services.hermes-grpc.loadbalancer.server.scheme=h2c" hermes-notifier: - image: ghcr.io/ownmfa/hermes:d7dbe626 + image: ghcr.io/ownmfa/hermes:2298e54d command: hermes-notifier restart: on-failure environment: diff --git a/go.mod b/go.mod index cb0da3a0..c36af866 100644 --- a/go.mod +++ b/go.mod @@ -6,12 +6,12 @@ require ( github.com/NYTimes/gziphandler v1.1.1 github.com/google/uuid v1.5.0 github.com/gregdel/pushover v1.3.0 - github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 github.com/jackc/pgx/v5 v5.5.1 github.com/jellydator/ttlcache/v3 v3.1.1 github.com/mennanov/fmutils v0.2.1 github.com/nsqio/go-nsq v1.1.0 - github.com/ownmfa/proto/go v1.1.0 + github.com/ownmfa/proto/go v1.1.1 github.com/redis/go-redis/v9 v9.3.1 github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e github.com/smira/go-statsd v1.3.3 @@ -38,8 +38,8 @@ require ( golang.org/x/sync v0.5.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect + google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index af6e31cc..f3b40033 100644 --- a/go.sum +++ b/go.sum @@ -522,8 +522,8 @@ github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+ github.com/gregdel/pushover v1.3.0 h1:CewbxqsThoN/1imgwkDKFkRkltaQMoyBV0K9IquQLtw= github.com/gregdel/pushover v1.3.0/go.mod h1:EcaO66Nn1StkpEm1iKtBTV3d2A16SoMsVER1PthX7to= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 h1:6UKoz5ujsI55KNpsJH3UwCq3T8kKbZwNZBNPuTTje8U= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1/go.mod h1:YvJ2f6MplWDhfxiUC3KpyTy76kYUZA4W3pTv/wdKQ9Y= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -552,8 +552,8 @@ github.com/mennanov/fmutils v0.2.1 h1:AUxeJv4o92vKbZaM4RBLZ/i8WzPF/UISTNeXB3gEIl github.com/mennanov/fmutils v0.2.1/go.mod h1:ph1jsu8gV1gUgMURCmfIVbXKG3O2/O5o/UbPbbqu8zs= github.com/nsqio/go-nsq v1.1.0 h1:PQg+xxiUjA7V+TLdXw7nVrJ5Jbl3sN86EhGCQj4+FYE= github.com/nsqio/go-nsq v1.1.0/go.mod h1:vKq36oyeVXgsS5Q8YEO7WghqidAVXQlcFxzQbQTuDEY= -github.com/ownmfa/proto/go v1.1.0 h1:kVzVa7Y200kGHYE39LMqnAE5vOL4KfEaKnOghigkNF8= -github.com/ownmfa/proto/go v1.1.0/go.mod h1:5CxxrnBJr06Agy5TSA2jX/2q/fB9qcXZ03tLir3Yw0E= +github.com/ownmfa/proto/go v1.1.1 h1:QjGm9ZoVDsHoAysiZdciSu6COZzkG4NHLW2ND92/Pdo= +github.com/ownmfa/proto/go v1.1.1/go.mod h1:iRbUFEYAV6fxhf9UGGR0fbI70V88ezNa7/0yJ/7pp84= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -1045,12 +1045,12 @@ google.golang.org/genproto v0.0.0-20221117204609-8f9c96812029/go.mod h1:rZS5c/ZV google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/genproto v0.0.0-20230202175211-008b39050e57/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 h1:YJ5pD9rF8o9Qtta0Cmy9rdBwkSjrTCT6XTiUQVOtIos= -google.golang.org/genproto v0.0.0-20231212172506-995d672761c0/go.mod h1:l/k7rMz0vFTBPy+tFSGvXEd3z+BcoG1k7EHbqm+YBsY= -google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 h1:s1w3X6gQxwrLEpxnLd/qXTVLgQE2yXwaOaoa6IlY/+o= -google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0/go.mod h1:CAny0tYF+0/9rmDB9fahA9YLzX3+AEVl1qXbv5hhj6c= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 h1:/jFB8jK5R3Sq3i/lmeZO0cATSzFfZaJq1J2Euan3XKU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0/go.mod h1:FUoWkonphQm3RhTS+kOEhF8h0iDpm4tdXolVCeZ9KKA= +google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 h1:nz5NESFLZbJGPFxDT/HCn+V1mZ8JGNoY4nUpmW/Y2eg= +google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917/go.mod h1:pZqR+glSb11aJ+JQcczCvgf47+duRuzNSKqE8YAQnV0= +google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 h1:rcS6EyEaoCO52hQDupoSfrxI3R6C2Tq741is7X8OvnM= +google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917/go.mod h1:CmlNWB9lSezaYELKS5Ym1r44VrrbPUa7JTvw+6MbpJ0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 h1:6G8oQ016D88m1xAKljMlBOOGWDZkes4kMhgGFlf8WcQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917/go.mod h1:xtjpI3tXFPP051KaWnhvxkiubL/6dJ18vLVf7q2pTOU= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/proto/go/message/ownmfa_notifier_in.pb.go b/proto/go/message/ownmfa_notifier_in.pb.go index 3df943b9..46e725f5 100644 --- a/proto/go/message/ownmfa_notifier_in.pb.go +++ b/proto/go/message/ownmfa_notifier_in.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc v4.24.4 // source: message/ownmfa_notifier_in.proto diff --git a/proto/go/token/ownmfa_page.pb.go b/proto/go/token/ownmfa_page.pb.go index 516667cb..6a89b009 100644 --- a/proto/go/token/ownmfa_page.pb.go +++ b/proto/go/token/ownmfa_page.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc v4.24.4 // source: token/ownmfa_page.proto diff --git a/proto/go/token/ownmfa_web.pb.go b/proto/go/token/ownmfa_web.pb.go index 2a11b2e6..122dd71e 100644 --- a/proto/go/token/ownmfa_web.pb.go +++ b/proto/go/token/ownmfa_web.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc v4.24.4 // source: token/ownmfa_web.proto diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/errors.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/errors.go index d2bcbb7d..230cac7b 100644 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/errors.go +++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/errors.go @@ -137,7 +137,7 @@ func DefaultHTTPErrorHandler(ctx context.Context, mux *ServeMux, marshaler Marsh doForwardTrailers := requestAcceptsTrailers(r) if doForwardTrailers { - handleForwardResponseTrailerHeader(w, md) + handleForwardResponseTrailerHeader(w, mux, md) w.Header().Set("Transfer-Encoding", "chunked") } @@ -152,7 +152,7 @@ func DefaultHTTPErrorHandler(ctx context.Context, mux *ServeMux, marshaler Marsh } if doForwardTrailers { - handleForwardResponseTrailer(w, md) + handleForwardResponseTrailer(w, mux, md) } } diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go index 305b1458..5e14cf8b 100644 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go +++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go @@ -3,7 +3,6 @@ package runtime import ( "context" "errors" - "fmt" "io" "net/http" "net/textproto" @@ -109,18 +108,20 @@ func handleForwardResponseServerMetadata(w http.ResponseWriter, mux *ServeMux, m } } -func handleForwardResponseTrailerHeader(w http.ResponseWriter, md ServerMetadata) { +func handleForwardResponseTrailerHeader(w http.ResponseWriter, mux *ServeMux, md ServerMetadata) { for k := range md.TrailerMD { - tKey := textproto.CanonicalMIMEHeaderKey(fmt.Sprintf("%s%s", MetadataTrailerPrefix, k)) - w.Header().Add("Trailer", tKey) + if h, ok := mux.outgoingTrailerMatcher(k); ok { + w.Header().Add("Trailer", textproto.CanonicalMIMEHeaderKey(h)) + } } } -func handleForwardResponseTrailer(w http.ResponseWriter, md ServerMetadata) { +func handleForwardResponseTrailer(w http.ResponseWriter, mux *ServeMux, md ServerMetadata) { for k, vs := range md.TrailerMD { - tKey := fmt.Sprintf("%s%s", MetadataTrailerPrefix, k) - for _, v := range vs { - w.Header().Add(tKey, v) + if h, ok := mux.outgoingTrailerMatcher(k); ok { + for _, v := range vs { + w.Header().Add(h, v) + } } } } @@ -148,12 +149,10 @@ func ForwardResponseMessage(ctx context.Context, mux *ServeMux, marshaler Marsha doForwardTrailers := requestAcceptsTrailers(req) if doForwardTrailers { - handleForwardResponseTrailerHeader(w, md) + handleForwardResponseTrailerHeader(w, mux, md) w.Header().Set("Transfer-Encoding", "chunked") } - handleForwardResponseTrailerHeader(w, md) - contentType := marshaler.ContentType(resp) w.Header().Set("Content-Type", contentType) @@ -179,7 +178,7 @@ func ForwardResponseMessage(ctx context.Context, mux *ServeMux, marshaler Marsha } if doForwardTrailers { - handleForwardResponseTrailer(w, md) + handleForwardResponseTrailer(w, mux, md) } } diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go index f451cb44..628e1fde 100644 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go +++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go @@ -57,6 +57,7 @@ type ServeMux struct { marshalers marshalerRegistry incomingHeaderMatcher HeaderMatcherFunc outgoingHeaderMatcher HeaderMatcherFunc + outgoingTrailerMatcher HeaderMatcherFunc metadataAnnotators []func(context.Context, *http.Request) metadata.MD errorHandler ErrorHandlerFunc streamErrorHandler StreamErrorHandlerFunc @@ -114,10 +115,18 @@ func DefaultHeaderMatcher(key string) (string, bool) { return "", false } +func defaultOutgoingHeaderMatcher(key string) (string, bool) { + return fmt.Sprintf("%s%s", MetadataHeaderPrefix, key), true +} + +func defaultOutgoingTrailerMatcher(key string) (string, bool) { + return fmt.Sprintf("%s%s", MetadataTrailerPrefix, key), true +} + // WithIncomingHeaderMatcher returns a ServeMuxOption representing a headerMatcher for incoming request to gateway. // // This matcher will be called with each header in http.Request. If matcher returns true, that header will be -// passed to gRPC context. To transform the header before passing to gRPC context, matcher should return modified header. +// passed to gRPC context. To transform the header before passing to gRPC context, matcher should return the modified header. func WithIncomingHeaderMatcher(fn HeaderMatcherFunc) ServeMuxOption { for _, header := range fn.matchedMalformedHeaders() { grpclog.Warningf("The configured forwarding filter would allow %q to be sent to the gRPC server, which will likely cause errors. See https://github.com/grpc/grpc-go/pull/4803#issuecomment-986093310 for more information.", header) @@ -147,13 +156,24 @@ func (fn HeaderMatcherFunc) matchedMalformedHeaders() []string { // // This matcher will be called with each header in response header metadata. If matcher returns true, that header will be // passed to http response returned from gateway. To transform the header before passing to response, -// matcher should return modified header. +// matcher should return the modified header. func WithOutgoingHeaderMatcher(fn HeaderMatcherFunc) ServeMuxOption { return func(mux *ServeMux) { mux.outgoingHeaderMatcher = fn } } +// WithOutgoingTrailerMatcher returns a ServeMuxOption representing a headerMatcher for outgoing response from gateway. +// +// This matcher will be called with each header in response trailer metadata. If matcher returns true, that header will be +// passed to http response returned from gateway. To transform the header before passing to response, +// matcher should return the modified header. +func WithOutgoingTrailerMatcher(fn HeaderMatcherFunc) ServeMuxOption { + return func(mux *ServeMux) { + mux.outgoingTrailerMatcher = fn + } +} + // WithMetadata returns a ServeMuxOption for passing metadata to a gRPC context. // // This can be used by services that need to read from http.Request and modify gRPC context. A common use case @@ -273,11 +293,11 @@ func NewServeMux(opts ...ServeMuxOption) *ServeMux { if serveMux.incomingHeaderMatcher == nil { serveMux.incomingHeaderMatcher = DefaultHeaderMatcher } - if serveMux.outgoingHeaderMatcher == nil { - serveMux.outgoingHeaderMatcher = func(key string) (string, bool) { - return fmt.Sprintf("%s%s", MetadataHeaderPrefix, key), true - } + serveMux.outgoingHeaderMatcher = defaultOutgoingHeaderMatcher + } + if serveMux.outgoingTrailerMatcher == nil { + serveMux.outgoingTrailerMatcher = defaultOutgoingTrailerMatcher } return serveMux diff --git a/vendor/github.com/ownmfa/proto/go/api/ownmfa_app_identity.pb.go b/vendor/github.com/ownmfa/proto/go/api/ownmfa_app_identity.pb.go index e1edddcb..422ac9fc 100644 --- a/vendor/github.com/ownmfa/proto/go/api/ownmfa_app_identity.pb.go +++ b/vendor/github.com/ownmfa/proto/go/api/ownmfa_app_identity.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc v4.24.4 // source: api/ownmfa_app_identity.proto diff --git a/vendor/github.com/ownmfa/proto/go/api/ownmfa_app_identity.pb.gw.go b/vendor/github.com/ownmfa/proto/go/api/ownmfa_app_identity.pb.gw.go index fbc47d0f..9040b08e 100644 --- a/vendor/github.com/ownmfa/proto/go/api/ownmfa_app_identity.pb.gw.go +++ b/vendor/github.com/ownmfa/proto/go/api/ownmfa_app_identity.pb.gw.go @@ -35,11 +35,7 @@ func request_AppIdentityService_CreateApp_0(ctx context.Context, marshaler runti var protoReq CreateAppRequest var metadata runtime.ServerMetadata - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.App); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.App); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -52,11 +48,7 @@ func local_request_AppIdentityService_CreateApp_0(ctx context.Context, marshaler var protoReq CreateAppRequest var metadata runtime.ServerMetadata - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.App); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.App); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -69,11 +61,7 @@ func request_AppIdentityService_CreateIdentity_0(ctx context.Context, marshaler var protoReq CreateIdentityRequest var metadata runtime.ServerMetadata - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Identity); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Identity); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -103,11 +91,7 @@ func local_request_AppIdentityService_CreateIdentity_0(ctx context.Context, mars var protoReq CreateIdentityRequest var metadata runtime.ServerMetadata - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Identity); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Identity); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -137,11 +121,7 @@ func request_AppIdentityService_ActivateIdentity_0(ctx context.Context, marshale var protoReq ActivateIdentityRequest var metadata runtime.ServerMetadata - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -181,11 +161,7 @@ func local_request_AppIdentityService_ActivateIdentity_0(ctx context.Context, ma var protoReq ActivateIdentityRequest var metadata runtime.ServerMetadata - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -297,11 +273,7 @@ func request_AppIdentityService_VerifyIdentity_0(ctx context.Context, marshaler var protoReq VerifyIdentityRequest var metadata runtime.ServerMetadata - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -341,11 +313,7 @@ func local_request_AppIdentityService_VerifyIdentity_0(ctx context.Context, mars var protoReq VerifyIdentityRequest var metadata runtime.ServerMetadata - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -506,18 +474,14 @@ func local_request_AppIdentityService_GetIdentity_0(ctx context.Context, marshal } var ( - filter_AppIdentityService_UpdateApp_0 = &utilities.DoubleArray{Encoding: map[string]int{"app": 0, "id": 1}, Base: []int{1, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 4, 2, 2, 3}} + filter_AppIdentityService_UpdateApp_0 = &utilities.DoubleArray{Encoding: map[string]int{"app": 0, "id": 1}, Base: []int{1, 2, 1, 0, 0}, Check: []int{0, 1, 2, 3, 2}} ) func request_AppIdentityService_UpdateApp_0(ctx context.Context, marshaler runtime.Marshaler, client AppIdentityServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq UpdateAppRequest var metadata runtime.ServerMetadata - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.App); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.App); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -554,11 +518,7 @@ func local_request_AppIdentityService_UpdateApp_0(ctx context.Context, marshaler var protoReq UpdateAppRequest var metadata runtime.ServerMetadata - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.App); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.App); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -592,7 +552,7 @@ func local_request_AppIdentityService_UpdateApp_0(ctx context.Context, marshaler } var ( - filter_AppIdentityService_UpdateApp_1 = &utilities.DoubleArray{Encoding: map[string]int{"app": 0, "id": 1}, Base: []int{1, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 4, 2, 2, 3}} + filter_AppIdentityService_UpdateApp_1 = &utilities.DoubleArray{Encoding: map[string]int{"app": 0, "id": 1}, Base: []int{1, 2, 1, 0, 0}, Check: []int{0, 1, 2, 3, 2}} ) func request_AppIdentityService_UpdateApp_1(ctx context.Context, marshaler runtime.Marshaler, client AppIdentityServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -852,7 +812,7 @@ func local_request_AppIdentityService_ListApps_0(ctx context.Context, marshaler } var ( - filter_AppIdentityService_ListIdentities_0 = &utilities.DoubleArray{Encoding: map[string]int{"app_id": 0, "appID": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_AppIdentityService_ListIdentities_0 = &utilities.DoubleArray{Encoding: map[string]int{"app_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_AppIdentityService_ListIdentities_0(ctx context.Context, marshaler runtime.Marshaler, client AppIdentityServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { diff --git a/vendor/github.com/ownmfa/proto/go/api/ownmfa_event.pb.go b/vendor/github.com/ownmfa/proto/go/api/ownmfa_event.pb.go index efe648e0..71194431 100644 --- a/vendor/github.com/ownmfa/proto/go/api/ownmfa_event.pb.go +++ b/vendor/github.com/ownmfa/proto/go/api/ownmfa_event.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc v4.24.4 // source: api/ownmfa_event.proto diff --git a/vendor/github.com/ownmfa/proto/go/api/ownmfa_org.pb.go b/vendor/github.com/ownmfa/proto/go/api/ownmfa_org.pb.go index f6f97d22..edcd8232 100644 --- a/vendor/github.com/ownmfa/proto/go/api/ownmfa_org.pb.go +++ b/vendor/github.com/ownmfa/proto/go/api/ownmfa_org.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc v4.24.4 // source: api/ownmfa_org.proto diff --git a/vendor/github.com/ownmfa/proto/go/api/ownmfa_org.pb.gw.go b/vendor/github.com/ownmfa/proto/go/api/ownmfa_org.pb.gw.go index d5f2703a..f8b5ede8 100644 --- a/vendor/github.com/ownmfa/proto/go/api/ownmfa_org.pb.gw.go +++ b/vendor/github.com/ownmfa/proto/go/api/ownmfa_org.pb.gw.go @@ -35,11 +35,7 @@ func request_OrgService_CreateOrg_0(ctx context.Context, marshaler runtime.Marsh var protoReq CreateOrgRequest var metadata runtime.ServerMetadata - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Org); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Org); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -52,11 +48,7 @@ func local_request_OrgService_CreateOrg_0(ctx context.Context, marshaler runtime var protoReq CreateOrgRequest var metadata runtime.ServerMetadata - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Org); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Org); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -118,18 +110,14 @@ func local_request_OrgService_GetOrg_0(ctx context.Context, marshaler runtime.Ma } var ( - filter_OrgService_UpdateOrg_0 = &utilities.DoubleArray{Encoding: map[string]int{"org": 0, "id": 1}, Base: []int{1, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 4, 2, 2, 3}} + filter_OrgService_UpdateOrg_0 = &utilities.DoubleArray{Encoding: map[string]int{"org": 0, "id": 1}, Base: []int{1, 2, 1, 0, 0}, Check: []int{0, 1, 2, 3, 2}} ) func request_OrgService_UpdateOrg_0(ctx context.Context, marshaler runtime.Marshaler, client OrgServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq UpdateOrgRequest var metadata runtime.ServerMetadata - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Org); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Org); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -166,11 +154,7 @@ func local_request_OrgService_UpdateOrg_0(ctx context.Context, marshaler runtime var protoReq UpdateOrgRequest var metadata runtime.ServerMetadata - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Org); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Org); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -204,7 +188,7 @@ func local_request_OrgService_UpdateOrg_0(ctx context.Context, marshaler runtime } var ( - filter_OrgService_UpdateOrg_1 = &utilities.DoubleArray{Encoding: map[string]int{"org": 0, "id": 1}, Base: []int{1, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 4, 2, 2, 3}} + filter_OrgService_UpdateOrg_1 = &utilities.DoubleArray{Encoding: map[string]int{"org": 0, "id": 1}, Base: []int{1, 2, 1, 0, 0}, Check: []int{0, 1, 2, 3, 2}} ) func request_OrgService_UpdateOrg_1(ctx context.Context, marshaler runtime.Marshaler, client OrgServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { diff --git a/vendor/github.com/ownmfa/proto/go/api/ownmfa_role.pb.go b/vendor/github.com/ownmfa/proto/go/api/ownmfa_role.pb.go index 87c1afe4..afe15daa 100644 --- a/vendor/github.com/ownmfa/proto/go/api/ownmfa_role.pb.go +++ b/vendor/github.com/ownmfa/proto/go/api/ownmfa_role.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc v4.24.4 // source: api/ownmfa_role.proto diff --git a/vendor/github.com/ownmfa/proto/go/api/ownmfa_session.pb.go b/vendor/github.com/ownmfa/proto/go/api/ownmfa_session.pb.go index c3df13a2..819ecc85 100644 --- a/vendor/github.com/ownmfa/proto/go/api/ownmfa_session.pb.go +++ b/vendor/github.com/ownmfa/proto/go/api/ownmfa_session.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc v4.24.4 // source: api/ownmfa_session.proto diff --git a/vendor/github.com/ownmfa/proto/go/api/ownmfa_session.pb.gw.go b/vendor/github.com/ownmfa/proto/go/api/ownmfa_session.pb.gw.go index cd3cba72..6691a89f 100644 --- a/vendor/github.com/ownmfa/proto/go/api/ownmfa_session.pb.gw.go +++ b/vendor/github.com/ownmfa/proto/go/api/ownmfa_session.pb.gw.go @@ -35,11 +35,7 @@ func request_SessionService_Login_0(ctx context.Context, marshaler runtime.Marsh var protoReq LoginRequest var metadata runtime.ServerMetadata - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -52,11 +48,7 @@ func local_request_SessionService_Login_0(ctx context.Context, marshaler runtime var protoReq LoginRequest var metadata runtime.ServerMetadata - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -69,11 +61,7 @@ func request_SessionService_CreateKey_0(ctx context.Context, marshaler runtime.M var protoReq CreateKeyRequest var metadata runtime.ServerMetadata - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Key); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Key); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -86,11 +74,7 @@ func local_request_SessionService_CreateKey_0(ctx context.Context, marshaler run var protoReq CreateKeyRequest var metadata runtime.ServerMetadata - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Key); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Key); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } diff --git a/vendor/github.com/ownmfa/proto/go/api/ownmfa_status.pb.go b/vendor/github.com/ownmfa/proto/go/api/ownmfa_status.pb.go index 31035f01..3bac00c1 100644 --- a/vendor/github.com/ownmfa/proto/go/api/ownmfa_status.pb.go +++ b/vendor/github.com/ownmfa/proto/go/api/ownmfa_status.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc v4.24.4 // source: api/ownmfa_status.proto diff --git a/vendor/github.com/ownmfa/proto/go/api/ownmfa_user.pb.go b/vendor/github.com/ownmfa/proto/go/api/ownmfa_user.pb.go index 5570f5be..78c871e4 100644 --- a/vendor/github.com/ownmfa/proto/go/api/ownmfa_user.pb.go +++ b/vendor/github.com/ownmfa/proto/go/api/ownmfa_user.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc v4.24.4 // source: api/ownmfa_user.proto diff --git a/vendor/github.com/ownmfa/proto/go/api/ownmfa_user.pb.gw.go b/vendor/github.com/ownmfa/proto/go/api/ownmfa_user.pb.gw.go index 7c552342..7bd3f10a 100644 --- a/vendor/github.com/ownmfa/proto/go/api/ownmfa_user.pb.gw.go +++ b/vendor/github.com/ownmfa/proto/go/api/ownmfa_user.pb.gw.go @@ -35,11 +35,7 @@ func request_UserService_CreateUser_0(ctx context.Context, marshaler runtime.Mar var protoReq CreateUserRequest var metadata runtime.ServerMetadata - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.User); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -52,11 +48,7 @@ func local_request_UserService_CreateUser_0(ctx context.Context, marshaler runti var protoReq CreateUserRequest var metadata runtime.ServerMetadata - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.User); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -118,18 +110,14 @@ func local_request_UserService_GetUser_0(ctx context.Context, marshaler runtime. } var ( - filter_UserService_UpdateUser_0 = &utilities.DoubleArray{Encoding: map[string]int{"user": 0, "id": 1}, Base: []int{1, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 4, 2, 2, 3}} + filter_UserService_UpdateUser_0 = &utilities.DoubleArray{Encoding: map[string]int{"user": 0, "id": 1}, Base: []int{1, 2, 1, 0, 0}, Check: []int{0, 1, 2, 3, 2}} ) func request_UserService_UpdateUser_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq UpdateUserRequest var metadata runtime.ServerMetadata - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.User); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -166,11 +154,7 @@ func local_request_UserService_UpdateUser_0(ctx context.Context, marshaler runti var protoReq UpdateUserRequest var metadata runtime.ServerMetadata - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.User); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -204,7 +188,7 @@ func local_request_UserService_UpdateUser_0(ctx context.Context, marshaler runti } var ( - filter_UserService_UpdateUser_1 = &utilities.DoubleArray{Encoding: map[string]int{"user": 0, "id": 1}, Base: []int{1, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 4, 2, 2, 3}} + filter_UserService_UpdateUser_1 = &utilities.DoubleArray{Encoding: map[string]int{"user": 0, "id": 1}, Base: []int{1, 2, 1, 0, 0}, Check: []int{0, 1, 2, 3, 2}} ) func request_UserService_UpdateUser_1(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -307,11 +291,7 @@ func request_UserService_UpdateUserPassword_0(ctx context.Context, marshaler run var protoReq UpdateUserPasswordRequest var metadata runtime.ServerMetadata - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -341,11 +321,7 @@ func local_request_UserService_UpdateUserPassword_0(ctx context.Context, marshal var protoReq UpdateUserPasswordRequest var metadata runtime.ServerMetadata - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } diff --git a/vendor/modules.txt b/vendor/modules.txt index 01465416..a6a10c6f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -30,7 +30,7 @@ github.com/google/uuid # github.com/gregdel/pushover v1.3.0 ## explicit; go 1.14 github.com/gregdel/pushover -# github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 +# github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 ## explicit; go 1.19 github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options @@ -70,7 +70,7 @@ github.com/mennanov/fmutils # github.com/nsqio/go-nsq v1.1.0 ## explicit; go 1.11 github.com/nsqio/go-nsq -# github.com/ownmfa/proto/go v1.1.0 +# github.com/ownmfa/proto/go v1.1.1 ## explicit; go 1.21.5 github.com/ownmfa/proto/go/api # github.com/pmezard/go-difflib v1.0.0 @@ -138,15 +138,15 @@ golang.org/x/text/transform golang.org/x/text/unicode/bidi golang.org/x/text/unicode/norm golang.org/x/text/width -# google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 +# google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 ## explicit; go 1.19 google.golang.org/genproto/internal -# google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 +# google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 ## explicit; go 1.19 google.golang.org/genproto/googleapis/api google.golang.org/genproto/googleapis/api/annotations google.golang.org/genproto/googleapis/api/httpbody -# google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 ## explicit; go 1.19 google.golang.org/genproto/googleapis/rpc/status # google.golang.org/grpc v1.60.1 diff --git a/web/hermes.swagger.json b/web/hermes.swagger.json index 79a51adc..ea2ee1dc 100644 --- a/web/hermes.swagger.json +++ b/web/hermes.swagger.json @@ -3,7 +3,7 @@ "info": { "title": "Hermes", "description": "Getting started with the Hermes API:\n- Log in with `/v1/sessions/login` using your provided credentials. Click `Authorize` below and enter the returned token.\n- Create an application with `/v1/applications`. For SMS and software token authentication methods, all template fields can be left empty.\n- (Optional) Create an `AUTHENTICATOR` role API key with `/v1/sessions/keys`. Re-authorize using the returned token.\n\nActivate an identity (single occurrence):\n- Create an identity with `/v1/applications/{identity.appID}/identities`. Only one method field is supported when creating an identity.\n- Issue the returned identity a challenge with `/v1/applications/{appID}/identities/{id}/challenge`.\n- Activate the identity with `/v1/applications/{appID}/identities/{id}/activate` using the received or generated challenge.\n\nVerify an identity (ongoing):\n- Issue the identity a challenge with `/v1/applications/{appID}/identities/{id}/challenge`.\n- Verify the identity with `/v1/applications/{appID}/identities/{id}/verify` using the received or generated challenge.", - "version": "1.1.0", + "version": "1.1.1", "contact": { "name": "OwnMFA", "url": "https://www.ownmfa.com/", @@ -517,17 +517,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "passcode": { - "type": "string", - "description": "Passcode for verification. For security questions identity methods, this is the answer to the security question." - } - }, - "description": "ActivateIdentityRequest is sent to activate an identity.", - "required": [ - "passcode" - ] + "$ref": "#/definitions/ActivateIdentityBody" } } ], @@ -623,17 +613,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "passcode": { - "type": "string", - "description": "Passcode for verification. For security questions identity methods, this is the answer to the security question." - } - }, - "description": "VerifyIdentityRequest is sent to verify an identity. If verification fails, the request does not automatically fall through to a backup codes method. Consuming applications should design a workflow that either explicitly verifies by backup codes or falls through on failure.", - "required": [ - "passcode" - ] + "$ref": "#/definitions/VerifyIdentityBody" } } ], @@ -1552,17 +1532,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "password": { - "type": "string", - "description": "User password to update." - } - }, - "description": "UpdateUserPasswordRequest is sent to update a user's password.", - "required": [ - "password" - ] + "$ref": "#/definitions/UpdateUserPasswordBody" } } ], @@ -1732,6 +1702,19 @@ } }, "definitions": { + "ActivateIdentityBody": { + "type": "object", + "properties": { + "passcode": { + "type": "string", + "description": "Passcode for verification. For security questions identity methods, this is the answer to the security question." + } + }, + "description": "ActivateIdentityRequest is sent to activate an identity.", + "required": [ + "passcode" + ] + }, "Any": { "type": "object", "properties": { @@ -2440,6 +2423,19 @@ }, "description": "SoftwareTOTPMethod configures a software OATH TOTP one-time password method." }, + "UpdateUserPasswordBody": { + "type": "object", + "properties": { + "password": { + "type": "string", + "description": "User password to update." + } + }, + "description": "UpdateUserPasswordRequest is sent to update a user's password.", + "required": [ + "password" + ] + }, "User": { "type": "object", "properties": { @@ -2484,6 +2480,19 @@ }, "description": "User represents a user as stored in the database." }, + "VerifyIdentityBody": { + "type": "object", + "properties": { + "passcode": { + "type": "string", + "description": "Passcode for verification. For security questions identity methods, this is the answer to the security question." + } + }, + "description": "VerifyIdentityRequest is sent to verify an identity. If verification fails, the request does not automatically fall through to a backup codes method. Consuming applications should design a workflow that either explicitly verifies by backup codes or falls through on failure.", + "required": [ + "passcode" + ] + }, "api.Status": { "type": "string", "enum": [