Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions api/proto/teleport/legacy/types/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3914,7 +3914,11 @@ message GithubConnectorSpecV3 {
(gogoproto.nullable) = false,
(gogoproto.jsontag) = "teams_to_roles"
];
// EndpointURL is the URL of the GitHub instance this connector is for.
string EndpointURL = 7 [(gogoproto.jsontag) = "endpoint_url"];
// APIEndpointURL is the URL of the API endpoint of the Github instance
// this connector is for.
string APIEndpointURL = 8 [(gogoproto.jsontag) = "api_endpoint_url"];
}

// GithubAuthRequest is the request to start Github OAuth2 flow.
Expand Down
12 changes: 11 additions & 1 deletion api/types/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ import (
"github.com/gravitational/teleport/api/utils"
)

const githubURL = "https://github.com"
const (
githubURL = "https://github.com"
githubAPIURL = "https://api.github.com"
)

// GithubConnector defines an interface for a Github OAuth2 connector
type GithubConnector interface {
Expand Down Expand Up @@ -65,6 +68,8 @@ type GithubConnector interface {
SetDisplay(string)
// GetEndpointURL returns the endpoint URL
GetEndpointURL() string
// GetAPIEndpointURL returns the API endpoint URL
GetAPIEndpointURL() string
}

// NewGithubConnector creates a new Github connector from name and spec
Expand Down Expand Up @@ -267,6 +272,11 @@ func (c *GithubConnectorV3) GetEndpointURL() string {
return githubURL
}

// GetEndpointURL returns the API endpoint URL
func (c *GithubConnectorV3) GetAPIEndpointURL() string {
return githubAPIURL
}

// MapClaims returns a list of logins based on the provided claims,
// returns a list of logins and list of kubernetes groups
func (c *GithubConnectorV3) MapClaims(claims GithubClaims) ([]string, []string, []string) {
Expand Down
Loading