diff --git a/documize/section/github/model.go b/documize/section/github/model.go index e060d96f..f1ca8ffe 100644 --- a/documize/section/github/model.go +++ b/documize/section/github/model.go @@ -17,6 +17,7 @@ import ( "time" "github.com/documize/community/wordsmith/log" + //gogithub "github.com/google/go-github/github" ) const tagIssuesData = "issues_data" @@ -218,8 +219,9 @@ type githubIssueActivity struct { */ type githubConfig struct { - AppKey string `json:"appKey"` // TODO keep? - Token string `json:"token"` + AppKey string `json:"appKey"` // TODO keep? + Token string `json:"token"` + //TokenOK bool `json:"tokenOK,omitempty"` Owner string `json:"owner_name"` Repo string `json:"repo_name"` Branch string `json:"branch"` @@ -263,6 +265,22 @@ func (c *githubConfig) Clean() { c.SincePtr = &since } } + + /* + authClient := gogithub.NewClient((&gogithub.BasicAuthTransport{ + Username: clientID(), + Password: clientSecret(), + }).Client()) + + auth, _, err := authClient.Authorizations.Check(clientID(), c.Token) + if err == nil { + //fmt.Printf("DEBUG auth %#v\n", *auth) + c.TokenOK = true + } else { + //fmt.Println("DEBUG auth err", err) + c.TokenOK = false + } + */ } type githubCallbackT struct {