mirror of
https://github.com/openziti/zrok.git
synced 2025-08-13 17:57:37 +02:00
initial cut at admin api operations (#537)
This commit is contained in:
@ -52,6 +52,9 @@ func NewZrokAPI(spec *loads.Document) *ZrokAPI {
|
||||
ShareAccessHandler: share.AccessHandlerFunc(func(params share.AccessParams, principal *rest_model_zrok.Principal) middleware.Responder {
|
||||
return middleware.NotImplemented("operation share.Access has not yet been implemented")
|
||||
}),
|
||||
AdminAddOrganizationMemberHandler: admin.AddOrganizationMemberHandlerFunc(func(params admin.AddOrganizationMemberParams, principal *rest_model_zrok.Principal) middleware.Responder {
|
||||
return middleware.NotImplemented("operation admin.AddOrganizationMember has not yet been implemented")
|
||||
}),
|
||||
AccountChangePasswordHandler: account.ChangePasswordHandlerFunc(func(params account.ChangePasswordParams, principal *rest_model_zrok.Principal) middleware.Responder {
|
||||
return middleware.NotImplemented("operation account.ChangePassword has not yet been implemented")
|
||||
}),
|
||||
@ -67,9 +70,15 @@ func NewZrokAPI(spec *loads.Document) *ZrokAPI {
|
||||
AdminCreateIdentityHandler: admin.CreateIdentityHandlerFunc(func(params admin.CreateIdentityParams, principal *rest_model_zrok.Principal) middleware.Responder {
|
||||
return middleware.NotImplemented("operation admin.CreateIdentity has not yet been implemented")
|
||||
}),
|
||||
AdminCreateOrganizationHandler: admin.CreateOrganizationHandlerFunc(func(params admin.CreateOrganizationParams, principal *rest_model_zrok.Principal) middleware.Responder {
|
||||
return middleware.NotImplemented("operation admin.CreateOrganization has not yet been implemented")
|
||||
}),
|
||||
AdminDeleteFrontendHandler: admin.DeleteFrontendHandlerFunc(func(params admin.DeleteFrontendParams, principal *rest_model_zrok.Principal) middleware.Responder {
|
||||
return middleware.NotImplemented("operation admin.DeleteFrontend has not yet been implemented")
|
||||
}),
|
||||
AdminDeleteOrganizationHandler: admin.DeleteOrganizationHandlerFunc(func(params admin.DeleteOrganizationParams, principal *rest_model_zrok.Principal) middleware.Responder {
|
||||
return middleware.NotImplemented("operation admin.DeleteOrganization has not yet been implemented")
|
||||
}),
|
||||
EnvironmentDisableHandler: environment.DisableHandlerFunc(func(params environment.DisableParams, principal *rest_model_zrok.Principal) middleware.Responder {
|
||||
return middleware.NotImplemented("operation environment.Disable has not yet been implemented")
|
||||
}),
|
||||
@ -109,6 +118,9 @@ func NewZrokAPI(spec *loads.Document) *ZrokAPI {
|
||||
AdminListFrontendsHandler: admin.ListFrontendsHandlerFunc(func(params admin.ListFrontendsParams, principal *rest_model_zrok.Principal) middleware.Responder {
|
||||
return middleware.NotImplemented("operation admin.ListFrontends has not yet been implemented")
|
||||
}),
|
||||
AdminListOrganizationMembersHandler: admin.ListOrganizationMembersHandlerFunc(func(params admin.ListOrganizationMembersParams, principal *rest_model_zrok.Principal) middleware.Responder {
|
||||
return middleware.NotImplemented("operation admin.ListOrganizationMembers has not yet been implemented")
|
||||
}),
|
||||
AccountLoginHandler: account.LoginHandlerFunc(func(params account.LoginParams) middleware.Responder {
|
||||
return middleware.NotImplemented("operation account.Login has not yet been implemented")
|
||||
}),
|
||||
@ -121,6 +133,9 @@ func NewZrokAPI(spec *loads.Document) *ZrokAPI {
|
||||
AccountRegisterHandler: account.RegisterHandlerFunc(func(params account.RegisterParams) middleware.Responder {
|
||||
return middleware.NotImplemented("operation account.Register has not yet been implemented")
|
||||
}),
|
||||
AdminRemoveOrganizationMemberHandler: admin.RemoveOrganizationMemberHandlerFunc(func(params admin.RemoveOrganizationMemberParams, principal *rest_model_zrok.Principal) middleware.Responder {
|
||||
return middleware.NotImplemented("operation admin.RemoveOrganizationMember has not yet been implemented")
|
||||
}),
|
||||
AccountResetPasswordHandler: account.ResetPasswordHandlerFunc(func(params account.ResetPasswordParams) middleware.Responder {
|
||||
return middleware.NotImplemented("operation account.ResetPassword has not yet been implemented")
|
||||
}),
|
||||
@ -200,6 +215,8 @@ type ZrokAPI struct {
|
||||
|
||||
// ShareAccessHandler sets the operation handler for the access operation
|
||||
ShareAccessHandler share.AccessHandler
|
||||
// AdminAddOrganizationMemberHandler sets the operation handler for the add organization member operation
|
||||
AdminAddOrganizationMemberHandler admin.AddOrganizationMemberHandler
|
||||
// AccountChangePasswordHandler sets the operation handler for the change password operation
|
||||
AccountChangePasswordHandler account.ChangePasswordHandler
|
||||
// MetadataConfigurationHandler sets the operation handler for the configuration operation
|
||||
@ -210,8 +227,12 @@ type ZrokAPI struct {
|
||||
AdminCreateFrontendHandler admin.CreateFrontendHandler
|
||||
// AdminCreateIdentityHandler sets the operation handler for the create identity operation
|
||||
AdminCreateIdentityHandler admin.CreateIdentityHandler
|
||||
// AdminCreateOrganizationHandler sets the operation handler for the create organization operation
|
||||
AdminCreateOrganizationHandler admin.CreateOrganizationHandler
|
||||
// AdminDeleteFrontendHandler sets the operation handler for the delete frontend operation
|
||||
AdminDeleteFrontendHandler admin.DeleteFrontendHandler
|
||||
// AdminDeleteOrganizationHandler sets the operation handler for the delete organization operation
|
||||
AdminDeleteOrganizationHandler admin.DeleteOrganizationHandler
|
||||
// EnvironmentDisableHandler sets the operation handler for the disable operation
|
||||
EnvironmentDisableHandler environment.DisableHandler
|
||||
// EnvironmentEnableHandler sets the operation handler for the enable operation
|
||||
@ -238,6 +259,8 @@ type ZrokAPI struct {
|
||||
AdminInviteTokenGenerateHandler admin.InviteTokenGenerateHandler
|
||||
// AdminListFrontendsHandler sets the operation handler for the list frontends operation
|
||||
AdminListFrontendsHandler admin.ListFrontendsHandler
|
||||
// AdminListOrganizationMembersHandler sets the operation handler for the list organization members operation
|
||||
AdminListOrganizationMembersHandler admin.ListOrganizationMembersHandler
|
||||
// AccountLoginHandler sets the operation handler for the login operation
|
||||
AccountLoginHandler account.LoginHandler
|
||||
// MetadataOverviewHandler sets the operation handler for the overview operation
|
||||
@ -246,6 +269,8 @@ type ZrokAPI struct {
|
||||
AccountRegenerateTokenHandler account.RegenerateTokenHandler
|
||||
// AccountRegisterHandler sets the operation handler for the register operation
|
||||
AccountRegisterHandler account.RegisterHandler
|
||||
// AdminRemoveOrganizationMemberHandler sets the operation handler for the remove organization member operation
|
||||
AdminRemoveOrganizationMemberHandler admin.RemoveOrganizationMemberHandler
|
||||
// AccountResetPasswordHandler sets the operation handler for the reset password operation
|
||||
AccountResetPasswordHandler account.ResetPasswordHandler
|
||||
// AccountResetPasswordRequestHandler sets the operation handler for the reset password request operation
|
||||
@ -348,6 +373,9 @@ func (o *ZrokAPI) Validate() error {
|
||||
if o.ShareAccessHandler == nil {
|
||||
unregistered = append(unregistered, "share.AccessHandler")
|
||||
}
|
||||
if o.AdminAddOrganizationMemberHandler == nil {
|
||||
unregistered = append(unregistered, "admin.AddOrganizationMemberHandler")
|
||||
}
|
||||
if o.AccountChangePasswordHandler == nil {
|
||||
unregistered = append(unregistered, "account.ChangePasswordHandler")
|
||||
}
|
||||
@ -363,9 +391,15 @@ func (o *ZrokAPI) Validate() error {
|
||||
if o.AdminCreateIdentityHandler == nil {
|
||||
unregistered = append(unregistered, "admin.CreateIdentityHandler")
|
||||
}
|
||||
if o.AdminCreateOrganizationHandler == nil {
|
||||
unregistered = append(unregistered, "admin.CreateOrganizationHandler")
|
||||
}
|
||||
if o.AdminDeleteFrontendHandler == nil {
|
||||
unregistered = append(unregistered, "admin.DeleteFrontendHandler")
|
||||
}
|
||||
if o.AdminDeleteOrganizationHandler == nil {
|
||||
unregistered = append(unregistered, "admin.DeleteOrganizationHandler")
|
||||
}
|
||||
if o.EnvironmentDisableHandler == nil {
|
||||
unregistered = append(unregistered, "environment.DisableHandler")
|
||||
}
|
||||
@ -405,6 +439,9 @@ func (o *ZrokAPI) Validate() error {
|
||||
if o.AdminListFrontendsHandler == nil {
|
||||
unregistered = append(unregistered, "admin.ListFrontendsHandler")
|
||||
}
|
||||
if o.AdminListOrganizationMembersHandler == nil {
|
||||
unregistered = append(unregistered, "admin.ListOrganizationMembersHandler")
|
||||
}
|
||||
if o.AccountLoginHandler == nil {
|
||||
unregistered = append(unregistered, "account.LoginHandler")
|
||||
}
|
||||
@ -417,6 +454,9 @@ func (o *ZrokAPI) Validate() error {
|
||||
if o.AccountRegisterHandler == nil {
|
||||
unregistered = append(unregistered, "account.RegisterHandler")
|
||||
}
|
||||
if o.AdminRemoveOrganizationMemberHandler == nil {
|
||||
unregistered = append(unregistered, "admin.RemoveOrganizationMemberHandler")
|
||||
}
|
||||
if o.AccountResetPasswordHandler == nil {
|
||||
unregistered = append(unregistered, "account.ResetPasswordHandler")
|
||||
}
|
||||
@ -550,6 +590,10 @@ func (o *ZrokAPI) initHandlerCache() {
|
||||
if o.handlers["POST"] == nil {
|
||||
o.handlers["POST"] = make(map[string]http.Handler)
|
||||
}
|
||||
o.handlers["POST"]["/organization/add"] = admin.NewAddOrganizationMember(o.context, o.AdminAddOrganizationMemberHandler)
|
||||
if o.handlers["POST"] == nil {
|
||||
o.handlers["POST"] = make(map[string]http.Handler)
|
||||
}
|
||||
o.handlers["POST"]["/changePassword"] = account.NewChangePassword(o.context, o.AccountChangePasswordHandler)
|
||||
if o.handlers["GET"] == nil {
|
||||
o.handlers["GET"] = make(map[string]http.Handler)
|
||||
@ -567,10 +611,18 @@ func (o *ZrokAPI) initHandlerCache() {
|
||||
o.handlers["POST"] = make(map[string]http.Handler)
|
||||
}
|
||||
o.handlers["POST"]["/identity"] = admin.NewCreateIdentity(o.context, o.AdminCreateIdentityHandler)
|
||||
if o.handlers["POST"] == nil {
|
||||
o.handlers["POST"] = make(map[string]http.Handler)
|
||||
}
|
||||
o.handlers["POST"]["/organization"] = admin.NewCreateOrganization(o.context, o.AdminCreateOrganizationHandler)
|
||||
if o.handlers["DELETE"] == nil {
|
||||
o.handlers["DELETE"] = make(map[string]http.Handler)
|
||||
}
|
||||
o.handlers["DELETE"]["/frontend"] = admin.NewDeleteFrontend(o.context, o.AdminDeleteFrontendHandler)
|
||||
if o.handlers["DELETE"] == nil {
|
||||
o.handlers["DELETE"] = make(map[string]http.Handler)
|
||||
}
|
||||
o.handlers["DELETE"]["/organization"] = admin.NewDeleteOrganization(o.context, o.AdminDeleteOrganizationHandler)
|
||||
if o.handlers["POST"] == nil {
|
||||
o.handlers["POST"] = make(map[string]http.Handler)
|
||||
}
|
||||
@ -626,6 +678,10 @@ func (o *ZrokAPI) initHandlerCache() {
|
||||
if o.handlers["POST"] == nil {
|
||||
o.handlers["POST"] = make(map[string]http.Handler)
|
||||
}
|
||||
o.handlers["POST"]["/organization/members"] = admin.NewListOrganizationMembers(o.context, o.AdminListOrganizationMembersHandler)
|
||||
if o.handlers["POST"] == nil {
|
||||
o.handlers["POST"] = make(map[string]http.Handler)
|
||||
}
|
||||
o.handlers["POST"]["/login"] = account.NewLogin(o.context, o.AccountLoginHandler)
|
||||
if o.handlers["GET"] == nil {
|
||||
o.handlers["GET"] = make(map[string]http.Handler)
|
||||
@ -642,6 +698,10 @@ func (o *ZrokAPI) initHandlerCache() {
|
||||
if o.handlers["POST"] == nil {
|
||||
o.handlers["POST"] = make(map[string]http.Handler)
|
||||
}
|
||||
o.handlers["POST"]["/organization/remove"] = admin.NewRemoveOrganizationMember(o.context, o.AdminRemoveOrganizationMemberHandler)
|
||||
if o.handlers["POST"] == nil {
|
||||
o.handlers["POST"] = make(map[string]http.Handler)
|
||||
}
|
||||
o.handlers["POST"]["/resetPassword"] = account.NewResetPassword(o.context, o.AccountResetPasswordHandler)
|
||||
if o.handlers["POST"] == nil {
|
||||
o.handlers["POST"] = make(map[string]http.Handler)
|
||||
|
Reference in New Issue
Block a user