Documentation
¶
Index ¶
- Constants
- func CallbackGithub(ctx *gin.Context)
- func GithubOauthScript(ctx *gin.Context)
- func Index(ctx *gin.Context)
- func RegisterEntryFromConfig(configFilePath string) map[string]rkentry.Entry
- func Success(ctx *gin.Context)
- type BootConfig
- type Entry
- func (entry *Entry) Bootstrap(context.Context)
- func (entry *Entry) GetDescription() string
- func (entry *Entry) GetGithubUser(accessToken string) (*githubClient.User, error)
- func (entry *Entry) GetName() string
- func (entry *Entry) GetOauthConfig(dest string) (*oauth2.Config, error)
- func (entry *Entry) GetType() string
- func (entry *Entry) Interrupt(context.Context)
- func (entry *Entry) IsValidOauthDest(src string) bool
- func (entry *Entry) String() string
- type EntryOption
Constants ¶
View Source
const ( CallbackPathGithub = "/v1/oauth/callback/github" SuccessPathGithub = "/v1/oauth/success" InstallNewGithubAppUrl = "https://github.com/apps/pg-workstation-test/installations/new" )
View Source
const ( // EntryName name of entry EntryName = "ws-oauth" // EntryType type of entry EntryType = "ws-oauth" // EntryDescription description of entry EntryDescription = "Entry for oauth management entry." // GithubCallbackHost describes default callback address GithubCallbackHost = "http://localhost:8080" // Github type of oauth destination Github = "github" GithubAppPrivateKey = `` /* 1680-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
func CallbackGithub ¶
CallbackGithub @Summary Oauth callback @Id 40 @version 1.0 @Tags oauth @produce application/json @Param code query string true "Code" @Success 200 @Router /v1/oauth/callback/github [get]
func GithubOauthScript ¶
GithubOauthScript is temp API while developing. TODO Remove this API at first release
func RegisterEntryFromConfig ¶
RegisterEntryFromConfig is an implementation of: type EntryRegFunc func(string) map[string]rkentry.Entry
Types ¶
type BootConfig ¶
type BootConfig struct {
Oauth struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Github struct {
Enabled bool `yaml:"enabled" json:"enabled"`
CallbackHost string `yaml:"callbackHost" json:"callbackHost"`
ClientId string `yaml:"clientId" json:"clientId"`
ClientSecret string `yaml:"clientSecret" json:"clientSecret"`
Scopes []string `yaml:"scopes" json:"scopes"`
} `yaml:"github" json:"github"`
Logger struct {
ZapLogger struct {
Ref string `yaml:"ref" json:"ref"`
} `yaml:"zapLogger" json:"zapLogger"`
EventLogger struct {
Ref string `yaml:"ref" json:"ref"`
} `yaml:"eventLogger" json:"eventLogger"`
} `yaml:"logger" json:"logger"`
} `yaml:"oauth" json:"oauth"`
}
BootConfig is a struct which is for unmarshalled YAML
type Entry ¶
type Entry struct {
EntryName string `json:"entryName" yaml:"entryName"`
EntryType string `json:"entryType" yaml:"entryType"`
EntryDescription string `json:"entryDescription" yaml:"entryDescription"`
ZapLoggerEntry *rkentry.ZapLoggerEntry `json:"zapLoggerEntry" yaml:"zapLoggerEntry"`
EventLoggerEntry *rkentry.EventLoggerEntry `json:"eventLoggerEntry" yaml:"eventLoggerEntry"`
CallbackAddr string `json:"callbackAddr" yaml:"callbackAddr"`
// contains filtered or unexported fields
}
EntryImpl performs as manager of project and organizations
func RegisterEntry ¶
func RegisterEntry(opts ...EntryOption) *Entry
RegisterController will register Entry into GlobalAppCtx
func (*Entry) GetDescription ¶
GetDescription returns entry description
func (*Entry) GetGithubUser ¶
func (entry *Entry) GetGithubUser(accessToken string) (*githubClient.User, error)
func (*Entry) GetOauthConfig ¶
func (*Entry) IsValidOauthDest ¶
type EntryOption ¶
type EntryOption func(*Entry)
EntryOption will be extended in future.
func WithOauthConfig ¶
func WithOauthConfig(dest string, config *oauth2.Config) EntryOption
WithOauthConfig provide user
Click to show internal directories.
Click to hide internal directories.