feat: update annotation

This commit is contained in:
weloe
2023-10-15 01:18:40 +08:00
parent a0324da6bb
commit 8d64059a42
2 changed files with 21 additions and 1 deletions

View File

@@ -8,6 +8,26 @@ import (
/**
=========dispatcher api
*/
// Login
//
// 1. SSO-Client : User click login button in client.
// 2. SSO-Client : If not login, redirect to SSO-Server's ApiName.SsoAuth( called SsoEnforcer.SsoAuth() method in sso_server_api ).
// 3. SSO-Server : If not login, called config.NotLoginView() method in sso_server_api.
// 4. SSO-Server : In config.NotLoginView(), user entered username and password to login.
// 5. SSO-Server : If login successfully, called ApiName.SsoAuth( called SsoEnforcer.SsoAuth() method in sso_server_api ) again,
// then redirect SSO-Client's ApiName.DoLogin with ticket(random string value)
// 6. SSO-Client : Get id through checking ticket(random string).
// 6.1: If config.IsHttp == true, send http request to SSO-Server. SSO-Server check ticket, register logoutCallback url and returns loginId.
// If config.IsHttp == false, use adapter to check ticket.
// After check ticket successfully, if you set config.TicketResultHandle, called it.
// If config.TicketResultHandle is nil, check id, user login in client actually if loginId doesn't be nil, redirect back url.
// Logout
// If user logout in SSO-Server, request logoutCallback url to notify client to logout
// If user logout in SSO-Client, if ssoConfig.IsSlo && ssoConfig.IsHttp, send request to SSO-Server ApiName.SsoSignout. SSO-Server notify all clients to logout
//
//
// ServerDisPatcher dispatcher SSO-Server api, returns model.Result or string.
func (s *SsoEnforcer) ServerDisPatcher(ctx ctx.Context) interface{} {