oauth

package
v1.23.8 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MethodLogin    = "login"
	MethodLogout   = "logout"
	MethodPullTask = "pullTask"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BamBooException

type BamBooException struct {
	Name    string `json:"name"`
	Message string `json:"message"`
}

type BamBooLoginOutRequest

type BamBooLoginOutRequest struct {
	TimeStamp int64  `json:"timestamp"`
	TokenID   string `json:"tokenId"`
}

type BamBooLoginRequest

type BamBooLoginRequest struct {
	SystemCode     string `json:"systemCode"`
	IntegrationKey string `json:"integrationKey"`
	Force          bool   `json:"force"`
	TimeStamp      int64  `json:"timestamp"`
}

type BamBooMessage

type BamBooMessage struct {
	Success   bool  `json:"success"`
	TimeStamp int64 `json:"timestamp"`

	Message   string          `json:"message"`
	Exception BamBooException `json:"exception"`

	TokenID    string `json:"tokenId"`
	SystemCode string `json:"systemCode"`
	SystemName string `json:"systemName"`

	Data map[string]interface{} `json:"data"`
}

type BamBooUserSyncTool

type BamBooUserSyncTool struct {
	BambooOptions
	// contains filtered or unexported fields
}

竹云用户同步工具

func NewBamBooSyncTool

func NewBamBooSyncTool(bambooOptions *BambooOptions) *BamBooUserSyncTool

func (*BamBooUserSyncTool) Do

func (s *BamBooUserSyncTool) Do(syncData *BamBooMessage) error

func (*BamBooUserSyncTool) DoRequest

func (s *BamBooUserSyncTool) DoRequest(uri string, result *BamBooMessage) error

func (*BamBooUserSyncTool) Login

func (s *BamBooUserSyncTool) Login() error

func (*BamBooUserSyncTool) Logout

func (s *BamBooUserSyncTool) Logout() error

type BambooOptions

type BambooOptions struct {
	Host           string `json:"host,omitempty"`
	SystemCode     string `json:"systemCode,omitempty"`
	IntegrationKey string `json:"integrationKey,omitempty"`
}

func NewDefaultBambooOptions

func NewDefaultBambooOptions() *BambooOptions

type GitlabUser

type GitlabUser struct {
	Username string `json:"username"`
	Email    string `json:"email"`
}

type JWTOptions

type JWTOptions struct {
	JwtExpire time.Duration `json:"jwtExpire,omitempty" description:"jwt expire time"`
	JWTCert   string        `json:"jwtCert,omitempty" description:"jwt cert file"`
	JWTKey    string        `json:"jwtKey,omitempty" description:"jwt key file"`
}

func NewDefaultJWTOptions

func NewDefaultJWTOptions() *JWTOptions

type OauthTool

type OauthTool struct {
	OauthConfig *oauth2.Config

	ClientType  string
	UserInfoURL string
	// contains filtered or unexported fields
}

func NewOauthTool

func NewOauthTool(opts *Options) *OauthTool

func (*OauthTool) GetAccessToken

func (ot *OauthTool) GetAccessToken(code string) (*oauth2.Token, error)

func (*OauthTool) GetAuthAddr

func (ot *OauthTool) GetAuthAddr() string

func (*OauthTool) GetPersonInfo

func (ot *OauthTool) GetPersonInfo(token *oauth2.Token) (*GitlabUser, error)

type Options

type Options struct {
	Kind          string         `json:"kind,omitempty" description:"oauth kind"`
	UserInfoURL   string         `json:"userInfoURL,omitempty" description:"user info url"`
	AppID         string         `json:"appID,omitempty" description:"app id"`
	AppSecret     string         `json:"appSecret,omitempty" description:"app secret"`
	Scopes        []string       `json:"scopes,omitempty" description:"scopes"`
	TokenURL      string         `json:"tokenURL,omitempty" description:"token url"`
	AuthURL       string         `json:"authURL,omitempty" description:"auth url"`
	RedirectURL   string         `json:"redirectURL,omitempty" description:"redirect url"`
	BambooOptions *BambooOptions `json:"bambooOptions,omitempty" description:"bamboo options"`
}

func NewDefaultOptions

func NewDefaultOptions() *Options

Jump to

Keyboard shortcuts

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