Skip to content

Commit

Permalink
Initial commit of allowing owners for anonymous auth (#1029)
Browse files Browse the repository at this point in the history
  • Loading branch information
kfcampbell authored Oct 27, 2023
1 parent f85bfb8 commit 1741133
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions github/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package github

import (
"context"
"log"
"net/http"
"net/url"
"path"
Expand Down Expand Up @@ -152,17 +151,11 @@ func (c *Config) Meta() (interface{}, error) {
owner.v4client = v4client
owner.v3client = v3client

if c.Anonymous() {
log.Printf("[INFO] No token present; configuring anonymous owner.")
return &owner, nil
} else {
_, err = c.ConfigureOwner(&owner)
if err != nil {
return &owner, err
}
log.Printf("[INFO] Token present; configuring authenticated owner: %s", owner.name)
return &owner, nil
_, err = c.ConfigureOwner(&owner)
if err != nil {
return &owner, err
}
return &owner, nil
}

type previewHeaderInjectorTransport struct {
Expand Down

0 comments on commit 1741133

Please sign in to comment.