Skip to content

Commit

Permalink
ss: Add profile management and refactor internals
Browse files Browse the repository at this point in the history
This patch adds profile management ( closes #112 ) and many internals have been refactored as a preparation for implementing that flow:

- Flows (login, registration, profile management) have been decoupled and moved to selfservice/flows/<flow>
- The form parser has been reworked completely and now uses JSON for types assertions everywhere.
  • Loading branch information
aeneasr committed Nov 22, 2019
1 parent 6009f31 commit 9c28b40
Show file tree
Hide file tree
Showing 203 changed files with 8,956 additions and 2,763 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ cover:
.PHONY: sdk
sdk:
GO111MODULE=on go mod tidy
GO111MODULE=on swagger generate spec -x sdk/go/kratos -m -o ./docs/api.swagger.json
GO111MODULE=on swagger validate ./docs/api.swagger.json
GO111MODULE=on $$(go env GOPATH)/bin/swagger generate spec -x sdk/go/kratos -m -o ./docs/api.swagger.json
GO111MODULE=on $$(go env GOPATH)/bin/swagger validate ./docs/api.swagger.json
GO111MODULE=on go run ./contrib/swagutil sanitize ./docs/api.swagger.json

rm -rf ./sdk/go/kratos/*
GO111MODULE=off swagger generate client -f ./docs/api.swagger.json -t sdk/go/kratos -A Ory_Kratos
GO111MODULE=on $$(go env GOPATH)/bin/swagger generate client --allow-template-override -f ./docs/api.swagger.json -t sdk/go/kratos -A Ory_Kratos

cd sdk/go/kratos; goreturns -w -i -local github.com/ory $$(listx .)

Expand Down
1 change: 0 additions & 1 deletion cmd/client/identity.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package client

import (

"github.com/spf13/cobra"

"github.com/ory/x/cmdx"
Expand Down
25 changes: 16 additions & 9 deletions cmd/daemon/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ import (
"github.com/ory/x/metricsx"

"github.com/ory/kratos/driver"
"github.com/ory/kratos/selfservice"
"github.com/ory/kratos/selfservice/password"
"github.com/ory/kratos/selfservice/flow/login"
"github.com/ory/kratos/selfservice/flow/logout"
"github.com/ory/kratos/selfservice/flow/registration"
"github.com/ory/kratos/selfservice/strategy/password"
"github.com/ory/kratos/x"
)

Expand All @@ -33,9 +35,14 @@ func servePublic(d driver.Driver, wg *sync.WaitGroup, cmd *cobra.Command, args [
telemetry(cmd, n, d)

router := x.NewRouterPublic()
r.StrategyHandler().RegisterPublicRoutes(router)
r.LoginHandler().RegisterPublicRoutes(router)
r.RegistrationHandler().RegisterPublicRoutes(router)
r.LogoutHandler().RegisterPublicRoutes(router)
r.ProfileManagementHandler().RegisterPublicRoutes(router)
r.LoginStrategies().RegisterPublicRoutes(router)
r.RegistrationStrategies().RegisterPublicRoutes(router)
r.SessionHandler().RegisterPublicRoutes(router)
r.ErrorHandler().RegisterPublicRoutes(router)
r.SelfServiceErrorHandler().RegisterPublicRoutes(router)
r.HealthHandler().SetRoutes(router.Router, false)

n.Use(NewNegroniLoggerMiddleware(l.(*logrus.Logger), "public#"+c.SelfPublicURL().String()))
Expand Down Expand Up @@ -108,11 +115,11 @@ func telemetry(cmd *cobra.Command, n *negroni.Negroni, d driver.Driver) {
"/auth/methods/oidc/",
password.RegistrationPath,
password.LoginPath,
selfservice.BrowserLoginPath,
selfservice.BrowserLoginRequestsPath,
selfservice.BrowserLogoutPath,
selfservice.BrowserRegistrationPath,
selfservice.BrowserRegistrationRequestsPath,
login.BrowserLoginPath,
login.BrowserLoginRequestsPath,
logout.BrowserLogoutPath,
registration.BrowserRegistrationPath,
registration.BrowserRegistrationRequestsPath,
},
BuildVersion: d.Registry().BuildVersion(),
BuildHash: d.Registry().BuildHash(),
Expand Down
1 change: 1 addition & 0 deletions docs/.kratos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ urls:
default_return_to: http://return-to-3-test.ory.sh/
mfa_ui: http://test.kratos.ory.sh/mfa
login_ui: http://test.kratos.ory.sh/login
profile_ui: http://test.kratos.ory.sh/profile
registration_ui: http://test.kratos.ory.sh/register
self:
public: http://public.kratos.ory.sh
Expand Down
Loading

0 comments on commit 9c28b40

Please sign in to comment.