auth

package
v0.0.0-...-73f8a9c Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(username, password string) (string, error)

func Login

func Login(userName, Pwd string) (string, error)

func SetLoginService

func SetLoginService(impl LoginChecker)

Types

type AdminAuthToolImpl

type AdminAuthToolImpl struct {
}
var AdminAuthService AdminAuthToolImpl

func (AdminAuthToolImpl) GetReviewer

func (AdminAuthToolImpl) GetReviewer(userName string) (reviewerName string, err error)

func (AdminAuthToolImpl) IsDba

func (AdminAuthToolImpl) IsDba(userName string) (isDba bool, err error)

type Claims

type Claims struct {
	Username string `json:"username"  binding:"required"`
	Password string `json:"password"  binding:"required"`
	jwt.StandardClaims
}

func ParseToken

func ParseToken(token string) (*Claims, error)

type ConfAuthToolImpl

type ConfAuthToolImpl struct {
}
var ConfAuthService ConfAuthToolImpl

func (ConfAuthToolImpl) GetReviewer

func (ConfAuthToolImpl) GetReviewer(userName string) (reviewerName string, err error)

func (ConfAuthToolImpl) IsDba

func (ConfAuthToolImpl) IsDba(userName string) (isDba bool, err error)

type LoginChecker

type LoginChecker interface {
	Login(userName, pwd string) error
}

type MockAuth

type MockAuth struct {
}
var MockAuthService MockAuth

func (MockAuth) GetReviewer

func (MockAuth) GetReviewer(userName string) (reviewerName string, err error)

func (MockAuth) IsDba

func (MockAuth) IsDba(userName string) (isDba bool, err error)

type NetAuthToolImpl

type NetAuthToolImpl struct {
}
var NetAuthService NetAuthToolImpl

func (NetAuthToolImpl) GetReviewer

func (NetAuthToolImpl) GetReviewer(userName string) (reviewerName string, err error)

func (NetAuthToolImpl) IsDba

func (NetAuthToolImpl) IsDba(userName string) (isDba bool, err error)

type NetResp

type NetResp struct {
	Data struct {
		Ent struct {
			Items []struct {
				OpName string `json:"op_name"`
				Uid    string `json:"uid"`
			} `json:"items"`
		} `json:"ent"`
	} `json:"data"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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