Skip to content

Commit

Permalink
chore: regenerate and format
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Jul 8, 2021
1 parent 5e9089f commit 65f2583
Show file tree
Hide file tree
Showing 13 changed files with 3,980 additions and 9 deletions.
3,938 changes: 3,938 additions & 0 deletions docs/docs/.static/api.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/docs/self-service/flows/code/login/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const initApiFlow = {
go: {
label: 'Go',
language: 'go',
code: require('raw-loader!../../../../../../examples/go/selfserviceinit/login/main.go')
code: require('raw-loader!../../../../../../examples/go/selfservice/login/main.go')
.default
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/self-service/flows/code/logout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const apiFlow = {
go: {
label: 'Go',
language: 'go',
code: require('raw-loader!../../../../../../examples/go/selfservicesubmit/logout/main.go')
code: require('raw-loader!../../../../../../examples/go/selfservice/logout/main.go')
.default
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/self-service/flows/code/recovery/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const initApiFlow = {
go: {
label: 'Go',
language: 'go',
code: require('raw-loader!../../../../../../examples/go/selfserviceinit/recovery/main.go')
code: require('raw-loader!../../../../../../examples/go/selfservice/recovery/main.go')
.default
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/self-service/flows/code/registration/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const initApiFlow = {
go: {
label: 'Go',
language: 'go',
code: require('raw-loader!../../../../../../examples/go/selfserviceinit/registration/main.go')
code: require('raw-loader!../../../../../../examples/go/selfservice/registration/main.go')
.default
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/self-service/flows/code/settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const initApiFlow = {
go: {
label: 'Go',
language: 'go',
code: require('raw-loader!../../../../../../examples/go/selfserviceinit/settings/main.go')
code: require('raw-loader!../../../../../../examples/go/selfservice/settings/main.go')
.default
},
curlUnauth: {
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/self-service/flows/code/verification/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const initApiFlow = {
go: {
label: 'Go',
language: 'go',
code: require('raw-loader!../../../../../../examples/go/selfserviceinit/verification/main.go')
code: require('raw-loader!../../../../../../examples/go/selfservice/verification/main.go')
.default
}
}
Expand Down
7 changes: 6 additions & 1 deletion schema/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"net/http"
"os"

"github.com/ory/kratos/driver/config"

"github.com/julienschmidt/httprouter"
"github.com/pkg/errors"

Expand All @@ -20,6 +22,8 @@ type (
x.WriterProvider
x.LoggingProvider
IdentityTraitsProvider
x.CSRFProvider
config.Provider
}
Handler struct {
r handlerDependencies
Expand All @@ -36,11 +40,12 @@ func NewHandler(r handlerDependencies) *Handler {
const SchemasPath string = "schemas"

func (h *Handler) RegisterPublicRoutes(public *x.RouterPublic) {
h.r.CSRFHandler().IgnoreGlobs(fmt.Sprintf("/%s/*", SchemasPath))
public.GET(fmt.Sprintf("/%s/:id", SchemasPath), h.get)
}

func (h *Handler) RegisterAdminRoutes(admin *x.RouterAdmin) {
admin.GET(fmt.Sprintf("/%s/:id", SchemasPath), h.get)
admin.GET(fmt.Sprintf("/%s/:id", SchemasPath), x.RedirectToPublicRoute(h.r))
}

// Raw JSON Schema
Expand Down
5 changes: 5 additions & 0 deletions selfservice/flow/recovery/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ func (h *Handler) RegisterPublicRoutes(public *x.RouterPublic) {
}

func (h *Handler) RegisterAdminRoutes(admin *x.RouterAdmin) {
admin.GET(RouteInitBrowserFlow, x.RedirectToPublicRoute(h.d))
admin.GET(RouteInitAPIFlow, x.RedirectToPublicRoute(h.d))
admin.GET(RouteGetFlow, x.RedirectToPublicRoute(h.d))
admin.GET(RouteSubmitFlow, x.RedirectToPublicRoute(h.d))
admin.POST(RouteSubmitFlow, x.RedirectToPublicRoute(h.d))
}

// swagger:route GET /self-service/recovery/api v0alpha1 initializeSelfServiceRecoveryFlowWithoutBrowser
Expand Down
8 changes: 7 additions & 1 deletion selfservice/flow/registration/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ func (h *Handler) onAuthenticated(w http.ResponseWriter, r *http.Request, ps htt
handler(w, r, ps)
}

func (h *Handler) RegisterAdminRoutes(admin *x.RouterAdmin) {}
func (h *Handler) RegisterAdminRoutes(admin *x.RouterAdmin) {
admin.GET(RouteInitBrowserFlow, x.RedirectToPublicRoute(h.d))
admin.GET(RouteInitAPIFlow, x.RedirectToPublicRoute(h.d))
admin.GET(RouteGetFlow, x.RedirectToPublicRoute(h.d))
admin.POST(RouteSubmitFlow, x.RedirectToPublicRoute(h.d))
admin.GET(RouteSubmitFlow, x.RedirectToPublicRoute(h.d))
}

func (h *Handler) NewRegistrationFlow(w http.ResponseWriter, r *http.Request, ft flow.Type) (*Flow, error) {
f := NewFlow(h.d.Config(r.Context()), h.d.Config(r.Context()).SelfServiceFlowRegistrationRequestLifespan(), h.d.GenerateCSRFToken(r), r, ft)
Expand Down
7 changes: 7 additions & 0 deletions selfservice/flow/settings/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ func (h *Handler) RegisterPublicRoutes(public *x.RouterPublic) {
}

func (h *Handler) RegisterAdminRoutes(admin *x.RouterAdmin) {
admin.GET(RouteInitBrowserFlow, x.RedirectToPublicRoute(h.d))

admin.GET(RouteInitAPIFlow, x.RedirectToPublicRoute(h.d))
admin.GET(RouteGetFlow, x.RedirectToPublicRoute(h.d))

admin.POST(RouteSubmitFlow, x.RedirectToPublicRoute(h.d))
admin.GET(RouteSubmitFlow, x.RedirectToPublicRoute(h.d))
}

func (h *Handler) NewFlow(w http.ResponseWriter, r *http.Request, i *identity.Identity, ft flow.Type) (*Flow, error) {
Expand Down
9 changes: 8 additions & 1 deletion selfservice/flow/verification/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,14 @@ func (h *Handler) RegisterPublicRoutes(public *x.RouterPublic) {
public.GET(RouteSubmitFlow, h.submitFlow)
}

func (h *Handler) RegisterAdminRoutes(admin *x.RouterAdmin) {}
func (h *Handler) RegisterAdminRoutes(admin *x.RouterAdmin) {
admin.GET(RouteInitBrowserFlow, x.RedirectToPublicRoute(h.d))
admin.GET(RouteInitAPIFlow, x.RedirectToPublicRoute(h.d))
admin.GET(RouteGetFlow, x.RedirectToPublicRoute(h.d))

admin.POST(RouteSubmitFlow, x.RedirectToPublicRoute(h.d))
admin.GET(RouteSubmitFlow, x.RedirectToPublicRoute(h.d))
}

// swagger:route GET /self-service/verification/api v0alpha1 initializeSelfServiceVerificationFlowWithoutBrowser
//
Expand Down
3 changes: 3 additions & 0 deletions selfservice/strategy/link/strategy_recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ func (s *Strategy) RecoveryStrategyID() string {
}

func (s *Strategy) RegisterPublicRecoveryRoutes(public *x.RouterPublic) {
s.d.CSRFHandler().IgnorePath(RouteAdminCreateRecoveryLink)
public.POST(RouteAdminCreateRecoveryLink, x.RedirectToAdminRoute(s.d))

}

func (s *Strategy) RegisterAdminRecoveryRoutes(admin *x.RouterAdmin) {
Expand Down

0 comments on commit 65f2583

Please sign in to comment.