server

package
v0.0.0-...-51967d9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2023 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Path_Login              = "/login"
	Path_Login_Acceptance   = "/login-acceptance"
	Path_Email_Validate     = "/email-validate"
	Path_Register_Succeeded = "/register-succeeded"
	Path_Change_Password    = "/change-password"
	Path_User_Info          = "/user_info"
	Path_Profile            = "/profile"
	Path_Password_Reset     = "/password_reset"
	Path_Logout             = "/logout"
	Path_User_List          = "/ulist"
	Path_Add_User           = "/adduser"
)
View Source
const (
	LoginPath      = "/oauth2/auth/requests/login"
	ConsentPath    = "/oauth2/auth/requests/consent"
	LogoutPath     = "/oauth2/auth/requests/logout"
	SessionsPath   = "/oauth2/auth/sessions"
	IntrospectPath = "/oauth2/introspect"
)
View Source
const (
	Api_Path_Introspect_Token = "/api/introspect-token"
)

Variables

This section is empty.

Functions

func AcceptLogin

func AcceptLogin(s *IDPServer, ctx *goweb.Context, login_challenge string, user models.User)

func AddUserHandler

func AddUserHandler(s *IDPServer) goweb.HandlerFunc

func AddUserPostHandler

func AddUserPostHandler(s *IDPServer) goweb.HandlerFunc

func ApprovalNativeAppHandler

func ApprovalNativeAppHandler(s *IDPServer) goweb.HandlerFunc

func BindAdminHandler

func BindAdminHandler(s *IDPServer)

func ChangePasswordHandler

func ChangePasswordHandler(s *IDPServer) goweb.HandlerFunc

func EmailValidateHandler

func EmailValidateHandler(s *IDPServer) goweb.HandlerFunc

func IntrospectTokenHandler

func IntrospectTokenHandler(s *IDPServer) goweb.HandlerFunc

func LoginHandler

func LoginHandler(s *IDPServer) goweb.HandlerFunc

func PasswordResetHandler

func PasswordResetHandler(s *IDPServer) goweb.HandlerFunc

func RegisterHandler

func RegisterHandler(s *IDPServer) goweb.HandlerFunc

func RegisterSucceededHandler

func RegisterSucceededHandler(s *IDPServer) goweb.HandlerFunc

func UserListHandler

func UserListHandler(s *IDPServer) goweb.HandlerFunc

Types

type Config

type Config struct {
	HYDRA_HOST               string       `yaml:"hydra_host"`
	HYDRA_PUBLIC_PORT        string       `yaml:"hydra_public_port"`
	HYDRA_ADMIN_PORT         string       `yaml:"hydra_admin_port"`
	LISTEN_ADDRESS           string       `yaml:"listen_address"`
	WEBSITE_NAME             string       `yaml:"website_name"`
	SECRET                   string       `yaml:"secret"`
	DB_CONN_INFO             string       `yaml:"db_conn_info"`
	Post_Logout_Redirect_Uri string       `yaml:"post_logout_redirect_uri"`
	Introspect_Token_Url     string       `yaml:"introspect_token_url"`
	Email                    Config_email `yaml:"email"`
	Tls_cert_file            string       `yaml:"tls_cert_file"`
	Tls_key_file             string       `yaml:"tls_key_file"`
	Website_domain           string       `yaml:"website_domain"`
	Website_port             string       `yaml:"website_port"`
}

type Config_email

type Config_email struct {
	Smtp_username string `yaml:"smtp_username"`
	Smtp_password string `yaml:"smtp_password"`
	Smtp_addr     string `yaml:"smtp_addr"`
	Plain         bool   `yaml:"plain"`
}

type HandlerWidget

type HandlerWidget struct {
	// contains filtered or unexported fields
}

func (*HandlerWidget) Post_Process

func (hw *HandlerWidget) Post_Process(ctx *goweb.Context)

func (*HandlerWidget) Pre_Process

func (*HandlerWidget) Pre_Process(ctx *goweb.Context)

type HydraConsentAcceptBody

type HydraConsentAcceptBody struct {
	Grant_scope                 []string                      `json:"grant_scope"`
	Grant_access_token_audience []string                      `json:"grant_access_token_audience"`
	Remember                    bool                          `json:"remember"`
	Remember_for                int                           `json:"remember_for"`
	Session                     HydraConsentAcceptBodySession `json:"Session"`
}

type HydraConsentAcceptBodySession

type HydraConsentAcceptBodySession struct {
	Id_token map[string]interface{} `json:"id_token"`
}

type HydraConsentAcceptRes

type HydraConsentAcceptRes struct {
	Redirect_to string `json:"redirect_to"`
}

type HydraConsentRes

type HydraConsentRes struct {
	Skip                            bool        `json:"skip"`
	Subject                         string      `json:"subject"`
	Client                          interface{} `json:"client"`
	Request_url                     string      `json:"request_url"`
	Requested_scope                 []string    `json:"requested_scope"`
	Requested_access_token_audience []string    `json:"requested_access_token_audience"`
	Oidc_context                    interface{} `json:"oidc_context"`
	Context                         interface{} `json:"context"`
}

type HydraConsentSessionRes

type HydraConsentSessionRes struct {
	Consent_request HydraConsentSessionRes_Consent_request `json:"consent_request"`
}
type HydraConsentSessionRes_Consent_request struct {
	Client HydraConsentSessionRes_Consent_request_client `json:"client"`
}
type HydraConsentSessionRes_Consent_request_client struct {
	Client_id string `json:"client_id"`
}

type HydraLoginAcceptBody

type HydraLoginAcceptBody struct {
	Subject      string `json:"subject"`
	Remember     bool   `json:"remember"`
	Remember_for int    `json:"remember_for"`
	Acr          string `json:"acr"`
}

type HydraLoginAcceptRes

type HydraLoginAcceptRes struct {
	Redirect_to string `json:"redirect_to"`
}

type HydraLoginRes

type HydraLoginRes struct {
	Skip            bool                 `json:"skip"`
	Subject         string               `json:"subject"`
	Client          HydraLoginRes_Client `json:"client"`
	Request_url     string               `json:"request_url"`
	Requested_scope []string             `json:"requested_scope"`
	Oidc_context    interface{}          `json:"oidc_context"`
	Created_at      string               `json:"created_at"`
	Updated_at      string               `json:"updated_at"`
	Context         interface{}          `json:"context"`
}

type HydraLoginRes_Client

type HydraLoginRes_Client struct {
	Client_id string `json:"client_id"`
}

type HydraLogoutAcceptRes

type HydraLogoutAcceptRes struct {
	Redirect_to string `json:"redirect_to"`
}

type IDPServer

type IDPServer struct {
	// contains filtered or unexported fields
}

func NewIDPServer

func NewIDPServer(configPath string, skip_tls_verify bool) *IDPServer

func (*IDPServer) GetLoginUser

func (s *IDPServer) GetLoginUser(ctx *goweb.Context) (*models.User, error)

func (*IDPServer) GetStorage

func (server *IDPServer) GetStorage(ctx *goweb.Context) storage.Storage

func (*IDPServer) Serve

func (s *IDPServer) Serve()

type LoginModel

type LoginModel struct {
	AuthCodeUrl template.URL
}

type WebSocketClient

type WebSocketClient struct {
	// contains filtered or unexported fields
}

Client is a middleman between the websocket connection and the hub.

type WebSocketHub

type WebSocketHub struct {
	// contains filtered or unexported fields
}

type WebSocketMessage

type WebSocketMessage struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL