Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ss: Use JSON Schema to type assert form body #116

Merged
merged 2 commits into from
Nov 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ require (
github.com/ory/graceful v0.1.1
github.com/ory/herodot v0.6.2
github.com/ory/viper v1.5.6
github.com/ory/x v0.0.80
github.com/ory/x v0.0.82
github.com/pelletier/go-toml v1.6.0 // indirect
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2
github.com/pkg/errors v0.8.1
github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 // indirect
github.com/rubenv/sql-migrate v0.0.0-20190212093014-1007f53448d7
github.com/santhosh-tekuri/jsonschema/v2 v2.1.0
github.com/sirupsen/logrus v1.4.2
github.com/spf13/cobra v0.0.5
github.com/spf13/pflag v1.0.5 // indirect
Expand All @@ -64,7 +65,6 @@ require (
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4
golang.org/x/net v0.0.0-20191014212845-da9a3fd4c582 // indirect
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
golang.org/x/sys v0.0.0-20191105231009-c1f44814a5cd // indirect
golang.org/x/tools v0.0.0-20191105231337-689d0f08e67a
google.golang.org/appengine v1.6.5 // indirect
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
Expand Down
19 changes: 8 additions & 11 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,6 @@ github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRx
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/golang/gddo v0.0.0-20180828051604-96d2a289f41e/go.mod h1:xEhNfoBDX1hzLm2Nf80qUvZ2sVwoMZ8d6IE2SrsQfh4=
github.com/golang/gddo v0.0.0-20181116215533-9bd4a3295021 h1:HYV500jCgk+IC68L5sWrLFIWMpaUFfXXpJSAb7XOoBk=
github.com/golang/gddo v0.0.0-20181116215533-9bd4a3295021/go.mod h1:xEhNfoBDX1hzLm2Nf80qUvZ2sVwoMZ8d6IE2SrsQfh4=
github.com/golang/gddo v0.0.0-20190904175337-72a348e765d2 h1:xisWqjiKEff2B0KfFYGpCqc3M3zdTz+OHQHRc09FeYk=
github.com/golang/gddo v0.0.0-20190904175337-72a348e765d2/go.mod h1:xEhNfoBDX1hzLm2Nf80qUvZ2sVwoMZ8d6IE2SrsQfh4=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
Expand Down Expand Up @@ -523,21 +521,20 @@ github.com/ory/gojsonschema v1.2.0 h1:ePsM9vnsxVHrEHW9/bE2DyU4s34B/YdDtT4LoPnGNs
github.com/ory/gojsonschema v1.2.0/go.mod h1:BNZpdJgB74KOLSsWFvzw6roXg1I6O51WO8roMmW+T7Y=
github.com/ory/graceful v0.1.1 h1:zx+8tDObLPrG+7Tc8jKYlXsqWnLtOQA1IZ/FAAKHMXU=
github.com/ory/graceful v0.1.1/go.mod h1:zqu70l95WrKHF4AZ6tXHvAqAvpY6M7g6ttaAVcMm7KU=
github.com/ory/herodot v0.5.1/go.mod h1:3BOneqcyBsVybCPAJoi92KN2BpJHcmDqAMcAAaJiJow=
github.com/ory/herodot v0.6.2 h1:zOb5MsuMn7AH9/Ewc/EK83yqcNViK1m1l3C2UuP3RcA=
github.com/ory/herodot v0.6.2/go.mod h1:3BOneqcyBsVybCPAJoi92KN2BpJHcmDqAMcAAaJiJow=
github.com/ory/viper v1.5.6 h1:w4ceGgWwWLzAFYQ7bHaDZmwNsAto2JPVdyQjQnn7VWI=
github.com/ory/viper v1.5.6/go.mod h1:TYmpFpKLxjQwvT4f0QPpkOn4sDXU1kDgAwJpgLYiQ28=
github.com/ory/x v0.0.80 h1:Gv8puLh2Yn3cyx0k9vweQSfoR+xwgQAPQotkqX43Rjo=
github.com/ory/x v0.0.80/go.mod h1:WVlPrVNe4wtPfdXqE6B+x7a7xoTR2EFGIGxZTPdAuxw=
github.com/ory/x v0.0.81 h1:+vQ/RUV+gjmhW+KSR5/+77mkz0M01sj63BsQXdqQW2o=
github.com/ory/x v0.0.81/go.mod h1:tTHBYpqJ5TAn6hZD15Tr0/T1yOEtxp7prp1Sgk0V0M0=
github.com/ory/x v0.0.82 h1:Kjj0qPKQFNg9IzbUFg9CVm3mr/BaR7SKh3g8m/6/Cuw=
github.com/ory/x v0.0.82/go.mod h1:RXLPBG7B+hAViONVg0sHwK+U/ie1Y/NeXrq1JcARfoE=
github.com/parnurzeal/gorequest v0.2.15/go.mod h1:3Kh2QUMJoqw3icWAecsyzkpY7UzRfDhbRdTjtNwNiUE=
github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g=
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml v1.4.0 h1:u3Z1r+oOXJIkxqw34zVhyPgjBsm6X2wn21NWs/HfSeg=
github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo=
github.com/pelletier/go-toml v1.5.0 h1:5BakdOZdtKJ1FFk6QdL8iSGrMWsXgchNJcrnarjbmJQ=
github.com/pelletier/go-toml v1.5.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys=
github.com/pelletier/go-toml v1.6.0 h1:aetoXYr0Tv7xRU/V4B4IZJ2QcbtMUFoNb3ORp7TzIK4=
github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys=
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 h1:JhzVVoYvbOACxoUmOs6V/G4D5nPVUW73rKvXxP4XUJc=
Expand Down Expand Up @@ -568,6 +565,10 @@ github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
github.com/rubenv/sql-migrate v0.0.0-20190212093014-1007f53448d7 h1:ID2fzWzRFJcF/xf/8eLN9GW5CXb6NQnKfC+ksTwMNpY=
github.com/rubenv/sql-migrate v0.0.0-20190212093014-1007f53448d7/go.mod h1:WS0rl9eEliYI8DPnr3TOwz4439pay+qNgzJoVya/DmY=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/santhosh-tekuri/jsonschema v1.2.4 h1:hNhW8e7t+H1vgY+1QeEQpveR6D4+OwKPXCfD2aieJis=
github.com/santhosh-tekuri/jsonschema v1.2.4/go.mod h1:TEAUOeZSmIxTTuHatJzrvARHiuO9LYd+cIxzgEHCQI4=
github.com/santhosh-tekuri/jsonschema/v2 v2.1.0 h1:7KOtBzox6l1PbyZCuQfo923yIBpoMtGCDOD78P9lv9g=
github.com/santhosh-tekuri/jsonschema/v2 v2.1.0/go.mod h1:yzJzKUGV4RbWqWIBBP4wSOBqavX5saE02yirLS0OTyg=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/segmentio/analytics-go v3.0.1+incompatible h1:W7T3ieNQjPFMb+SE8SAVYo6mPkKK/Y37wYdiNf5lCVg=
github.com/segmentio/analytics-go v3.0.1+incompatible/go.mod h1:C7CYBtQWk4vRk2RyLu0qOcbHJ18E3F1HV2C/8JvKN48=
Expand Down Expand Up @@ -772,10 +773,6 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7 h1:LepdCS8Gf/MVejFIt8lsiexZATdoGVyp5bcyS+rYoUI=
golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191020152052-9984515f0562 h1:wOweSabW7qssfcg63CEDHHA4zyoqRlGU6eYV7IUMCq0=
golang.org/x/sys v0.0.0-20191020152052-9984515f0562/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191105231009-c1f44814a5cd h1:3x5uuvBgE6oaXJjCOvpCC1IpgJogqQ+PqGGU3ZxAgII=
golang.org/x/sys v0.0.0-20191105231009-c1f44814a5cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
46 changes: 45 additions & 1 deletion selfservice/errors.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package selfservice

import (
"fmt"
"net/http"
"net/url"

"github.com/golang/gddo/httputil"
"github.com/ory/x/jsonschemax"
"github.com/pkg/errors"
"github.com/santhosh-tekuri/jsonschema/v2"

"github.com/ory/herodot"
"github.com/ory/x/urlx"
Expand All @@ -32,6 +35,10 @@ var (
WithError("login request expired").
WithReasonf(`The login request has expired. Please restart the flow.`)

ErrProfileRequestExpired = herodot.ErrBadRequest.
WithError("profile request expired").
WithReasonf(`The profile request has expired. Please restart the flow.`)

ErrRegistrationRequestExpired = herodot.ErrBadRequest.
WithError("registration request expired").
WithReasonf(`The registration request has expired. Please restart the flow.`)
Expand Down Expand Up @@ -103,6 +110,8 @@ func (s *ErrorHandler) json(

func (s *ErrorHandler) handleHerodotError(err *herodot.DefaultError, config RequestMethodConfig) error {
switch err.Error() {
case herodot.ErrBadRequest.Error():
config.AddError(&FormError{Message: err.Reason()})
case ErrIDTokenMissing.Error():
config.AddError(&FormError{Message: err.Reason()})
case ErrScopeMissing.Error():
Expand All @@ -118,7 +127,29 @@ func (s *ErrorHandler) handleHerodotError(err *herodot.DefaultError, config Requ
return nil
}

func (s *ErrorHandler) handleValidationError(r *http.Request, err schema.ResultErrors, config RequestMethodConfig, opts *ErrorHandlerOptions) error {
func (s *ErrorHandler) handleValidationError(r *http.Request, err *jsonschema.ValidationError, config RequestMethodConfig, opts *ErrorHandlerOptions) error {
for k := range r.PostForm {
if !stringslice.Has(opts.IgnoreValuesForKeys, k) {
config.GetFormFields().SetValue(k, s.bd.ParseFormFieldOr(r.PostForm[k], r.PostForm.Get(k)))
}
}

for k, v := range opts.AdditionalKeys {
config.GetFormFields().SetValue(k, v)
}

for k, e := range err.Causes {
herodot.DefaultErrorLogger(s.d.Logger(), err).
Debugf("A validation error was caught (%d of %d): %s", k+1, len(err.Causes), e.Error())
fe := &FormError{Field: jsonschemax.JSONPointerToDotNotation(e.InstancePtr), Message: e.Message}
config.AddError(fe)
config.GetFormFields().SetError(jsonschemax.JSONPointerToDotNotation(e.InstancePtr), fe)
}

return nil
}

func (s *ErrorHandler) handleDeprecatedValidationError(r *http.Request, err schema.ResultErrors, config RequestMethodConfig, opts *ErrorHandlerOptions) error {
for k := range r.PostForm {
if !stringslice.Has(opts.IgnoreValuesForKeys, k) {
config.GetFormFields().SetValue(k, s.bd.ParseFormFieldOr(r.PostForm[k], r.PostForm.Get(k)))
Expand Down Expand Up @@ -158,10 +189,13 @@ func (s *ErrorHandler) handleError(

config := method.Config
config.Reset()

switch e := errors.Cause(err).(type) {
case *herodot.DefaultError:
return &config, s.handleHerodotError(e, config)
case schema.ResultErrors:
return &config, s.handleDeprecatedValidationError(r, e, config, opts)
case *jsonschema.ValidationError:
return &config, s.handleValidationError(r, e, config, opts)
}

Expand All @@ -176,6 +210,11 @@ func (s *ErrorHandler) HandleRegistrationError(
err error,
opts *ErrorHandlerOptions,
) {
s.d.Logger().WithError(err).
WithField("details", fmt.Sprintf("%+v", err)).
WithField("credentials_type", ct).
WithField("registration_request", rr).
Warn("Encountered registration error.")
opts = mergeErrorHandlerOptions(opts)

if rr == nil {
Expand Down Expand Up @@ -210,6 +249,11 @@ func (s *ErrorHandler) HandleLoginError(
err error,
opts *ErrorHandlerOptions,
) {
s.d.Logger().WithError(err).
WithField("details", fmt.Sprintf("%+v", err)).
WithField("credentials_type", ct).
WithField("login_request", rr).
Warn("Encountered login error.")
opts = mergeErrorHandlerOptions(opts)

if rr == nil {
Expand Down
6 changes: 2 additions & 4 deletions selfservice/password/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ func (s *Strategy) handleLogin(w http.ResponseWriter, r *http.Request, _ httprou
s.handleLoginError(w, r, ar, errors.WithStack(herodot.ErrBadRequest.WithDebug(err.Error()).WithReasonf("Unable to parse HTTP form request: %s", err.Error())))
return
}
if err := s.dc.Decode(&p, r.PostForm); err != nil {
s.handleLoginError(w, r, ar, errors.WithStack(herodot.ErrBadRequest.WithDebug(err.Error()).WithReasonf("Unable to parse HTTP form payload: %s", err.Error())))
return
}
p.Identifier = r.PostForm.Get("identifier")
p.Password = r.PostForm.Get("password")

if len(p.Identifier) == 0 {
s.handleLoginError(w, r, ar, errors.WithStack(schema.NewRequiredError("", gojsonschema.NewJsonContext("identifier", nil))))
Expand Down
8 changes: 4 additions & 4 deletions selfservice/password/login_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ func TestLogin(t *testing.T) {
rid: "0",
payload: "14=)=!(%)$/ZP()GHIÖ",
assert: func(t *testing.T, r *http.Response) {
assert.Contains(t, r.Request.URL.Path, "error-ts")
assert.Contains(t, r.Request.URL.Path, "login-ts")
body, err := ioutil.ReadAll(r.Body)
require.NoError(t, err)

assert.Equal(t, int64(http.StatusBadRequest), gjson.GetBytes(body, "0.code").Int(), "%s", body)
assert.Equal(t, "Bad Request", gjson.GetBytes(body, "0.status").String(), "%s", body)
assert.Contains(t, gjson.GetBytes(body, "0.reason").String(), "invalid URL escape", "%s", body)
assert.Equal(t, "request-0", gjson.GetBytes(body, "id").String(), "%s", body)
assert.Equal(t, "/action", gjson.GetBytes(body, "methods.password.config.action").String())
assert.Contains(t, gjson.GetBytes(body, "methods.password.config.errors.0.message").String(), `invalid URL escape`)
},
},
{
Expand Down
44 changes: 43 additions & 1 deletion selfservice/password/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import (
"net/url"

"github.com/julienschmidt/httprouter"
"github.com/ory/x/decoderx"
_ "github.com/ory/x/jsonschemax/fileloader"
_ "github.com/ory/x/jsonschemax/httploader"
"github.com/pkg/errors"
"github.com/tidwall/sjson"

"github.com/ory/gojsonschema"
"github.com/ory/herodot"
Expand All @@ -22,6 +26,20 @@ import (

const (
RegistrationPath = "/auth/browser/methods/password/registration"

registrationFormPayloadSchema = `{
"$id": "https://schemas.ory.sh/kratos/selfservice/password/registration/config.schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"required": ["password", "traits"],
"properties": {
"password": {
"type": "string",
"minLength": 1
},
"traits": {}
}
}`
)

type RegistrationFormPayload struct {
Expand All @@ -46,6 +64,20 @@ func (s *Strategy) handleRegistrationError(w http.ResponseWriter, r *http.Reques
)
}

func (s *Strategy) decoderRegistration() (decoderx.HTTPDecoderOption, error) {
raw, err := sjson.SetBytes([]byte(registrationFormPayloadSchema), "properties.traits.$ref", s.c.DefaultIdentityTraitsSchemaURL().String())
if err != nil {
return nil, errors.WithStack(err)
}

o, err := decoderx.HTTPRawJSONSchemaCompiler(raw)
if err != nil {
return nil, errors.WithStack(err)
}

return o, nil
}

func (s *Strategy) handleRegistration(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
rid := r.URL.Query().Get("request")
if len(rid) == 0 {
Expand All @@ -65,7 +97,17 @@ func (s *Strategy) handleRegistration(w http.ResponseWriter, r *http.Request, _
}

var p RegistrationFormPayload
if err := s.dec.Decode(r, &p, selfservice.BodyDecoderOptions{AssertTypesForPrefix: "traits."}); err != nil {
option, err := s.decoderRegistration()
if err != nil {
s.handleRegistrationError(w, r, ar, err)
return
}

if err := decoderx.NewHTTP().Decode(r, &p,
decoderx.HTTPFormDecoder(),
option,
decoderx.HTTPDecoderSetValidatePayloads(false),
); err != nil {
s.handleRegistrationError(w, r, ar, err)
return
}
Expand Down
11 changes: 5 additions & 6 deletions selfservice/password/registration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,9 @@ func TestRegistration(t *testing.T) {
t.Run("case=should show the error ui because the request payload is malformed", func(t *testing.T) {
rr := newRegistrationRequest(t, time.Minute)
body, res := makeRequest(t, rr.ID, "14=)=!(%)$/ZP()GHIÖ", http.StatusOK)
assert.Contains(t, res.Request.URL.Path, "error-ts")
assert.Equal(t, int64(http.StatusBadRequest), gjson.GetBytes(body, "0.code").Int(), "%s", body)
assert.Equal(t, "Bad Request", gjson.GetBytes(body, "0.status").String(), "%s", body)
assert.Contains(t, gjson.GetBytes(body, "0.reason").String(), "invalid URL escape", "%s", body)
assert.Contains(t, res.Request.URL.Path, "signup-ts")
assert.Equal(t, rr.ID, gjson.GetBytes(body, "id").String(), "%s", body)
assert.Contains(t, gjson.GetBytes(body, "methods.password.config.errors.0.message").String(), "invalid URL escape", "%s", body)
})

t.Run("case=should show the error ui because the request id is missing", func(t *testing.T) {
Expand Down Expand Up @@ -165,7 +164,7 @@ func TestRegistration(t *testing.T) {
assert.Contains(t, gjson.GetBytes(body, "0.reason").String(), "No login identifiers", "%s", body)
})

t.Run("case=should fail because schema did not specify an identifier", func(t *testing.T) {
t.Run("case=should fail because schema does not exist", func(t *testing.T) {
viper.Set(configuration.ViperKeyDefaultIdentityTraitsSchemaURL, "file://./stub/i-do-not-exist.schema.json")
rr := newRegistrationRequest(t, time.Minute)
body, res := makeRequest(t, rr.ID, url.Values{
Expand All @@ -176,7 +175,7 @@ func TestRegistration(t *testing.T) {
assert.Contains(t, res.Request.URL.Path, "error-ts")
assert.Equal(t, int64(http.StatusInternalServerError), gjson.GetBytes(body, "0.code").Int(), "%s", body)
assert.Equal(t, "Internal Server Error", gjson.GetBytes(body, "0.status").String(), "%s", body)
assert.Contains(t, gjson.GetBytes(body, "0.reason").String(), "Unable to parse JSON schema", "%s", body)
assert.Contains(t, gjson.GetBytes(body, "0.reason").String(), "no such file or directory", "%s", body)
})

t.Run("case=should pass and set up a session", func(t *testing.T) {
Expand Down
13 changes: 13 additions & 0 deletions selfservice/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@ func (r *LoginRequest) Valid() error {
return nil
}

type ProfileRequest struct{ *Request }

func NewProfileRequest(exp time.Duration, r *http.Request) *ProfileRequest {
return &ProfileRequest{Request: newRequestFromHTTP(exp, r)}
}

func (r *ProfileRequest) Valid() error {
if r.ExpiresAt.Before(time.Now()) {
return errors.WithStack(ErrProfileRequestExpired.WithReasonf("The profile request expired %.2f minutes ago, please try again", time.Since(r.ExpiresAt).Minutes()))
}
return nil
}

type Request struct {
ID string `json:"id"`
IssuedAt time.Time `json:"issued_at"`
Expand Down
10 changes: 10 additions & 0 deletions selfservice/request_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ type RequestManager interface {
LoginRequestManager
}

type ProfileRequestManager interface {
CreateProfileRequest(context.Context, *LoginRequest) error
GetProfileRequest(ctx context.Context, id string) (*LoginRequest, error)
UpdateProfileRequest(context.Context, string, identity.CredentialsType, RequestMethodConfig) error
}

type ProfileRequestManagementProvider interface {
ProfileRequestManager() ProfileRequestManager
}

type LoginRequestManager interface {
CreateLoginRequest(context.Context, *LoginRequest) error
GetLoginRequest(ctx context.Context, id string) (*LoginRequest, error)
Expand Down
29 changes: 0 additions & 29 deletions x/content_type.go

This file was deleted.

Loading