Documentation
¶
Index ¶
- Constants
- Variables
- func InitTables(db *sql.DB) error
- func NewAPIServer(authService AuthService, ipamService ipam.IPAMService, allowedOrigins []string, ...) *web.Service
- type APIService
- type AuthService
- func (s AuthService) MasterAuthMiddleware(next http.Handler) http.Handler
- func (s AuthService) NewToken() (string, error)
- func (s AuthService) RequireAuthMiddleware(next http.Handler) http.Handler
- func (s AuthService) TokenAuthMiddleware(next http.Handler) http.Handler
- func (s AuthService) ValidateAndBurnToken(token string) error
- type ConnectGetOutput
- type TokenGetOutput
Constants ¶
View Source
const DefaultExpirationTime = 24 * time.Hour
Variables ¶
View Source
var ( ErrTokenNotFound = errors.New("token not found or already used") ErrTokenExpired = errors.New("token has expired") )
Functions ¶
func InitTables ¶
func NewAPIServer ¶
func NewAPIServer( authService AuthService, ipamService ipam.IPAMService, allowedOrigins []string, nebulaPubAddr, caCert, caKey string, ) *web.Service
Types ¶
type APIService ¶
type APIService struct {
AuthService AuthService
IPAMService ipam.IPAMService
NebulaPublicAddr string
CACert string
CAKey string
}
func (APIService) ConnectGet ¶
func (s APIService) ConnectGet(ctx context.Context, input struct{}, output *ConnectGetOutput) error
func (APIService) TokenGet ¶
func (s APIService) TokenGet(ctx context.Context, input struct{}, output *TokenGetOutput) error
type AuthService ¶
type AuthService struct {
DB *sql.DB
MasterToken string
MasterLocalhostOnly bool
TokenAuthDisabled bool
}
func (AuthService) MasterAuthMiddleware ¶
func (s AuthService) MasterAuthMiddleware(next http.Handler) http.Handler
func (AuthService) NewToken ¶
func (s AuthService) NewToken() (string, error)
func (AuthService) RequireAuthMiddleware ¶
func (s AuthService) RequireAuthMiddleware(next http.Handler) http.Handler
func (AuthService) TokenAuthMiddleware ¶
func (s AuthService) TokenAuthMiddleware(next http.Handler) http.Handler
func (AuthService) ValidateAndBurnToken ¶
func (s AuthService) ValidateAndBurnToken(token string) error
type ConnectGetOutput ¶
type ConnectGetOutput struct {
ConnectionConfig string `json:"connection_config"`
}
type TokenGetOutput ¶
type TokenGetOutput struct {
OntTimeToken string `json:"one_time_token"`
}
Click to show internal directories.
Click to hide internal directories.