Skip to content

Commit

Permalink
Document newly exported functions
Browse files Browse the repository at this point in the history
  • Loading branch information
andyfeller committed Apr 10, 2024
1 parent 7b29c8e commit 8d04841
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/auth/auth.go
Expand Up @@ -152,11 +152,15 @@ func defaultHost(cfg *config.Config) (string, string) {
// TenancyHost is the domain name of a tenancy GitHub instance.
const tenancyHost = "ghe.com"

// IsEnterprise determines if a provided host is a GitHub Enterprise Server instance,
// rather than GitHub.com or a tenancy GitHub instance.
func IsEnterprise(host string) bool {
normalizedHost := normalizeHostname(host)
return normalizedHost != github && normalizedHost != localhost && !IsTenancy(normalizedHost)
}

// IsTenancy determines if a provided host is a tenancy GitHub instance,
// rather than GitHub.com or a GitHub Enterprise Server instance.
func IsTenancy(host string) bool {
normalizedHost := normalizeHostname(host)
return strings.HasSuffix(normalizedHost, "."+tenancyHost)
Expand Down

0 comments on commit 8d04841

Please sign in to comment.