Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow reuse of host checks for extension authors #152

Merged
merged 6 commits into from
Apr 29, 2024

Conversation

andyfeller
Copy link
Contributor

Following on the heels of #151, this commit exports the internal logic used to determine if a host is GHES deployment or a tenant.

Exporting these functions allow extension authors like github/gh-copilot to provide tailored experiences consistently with gh.

Following on the heels of #151, this commit exports the internal logic used to
determine if a host is GHES deployment or a tenant.

Exporting these functions allow extension authors like `github/gh-copilot` to
provide tailored experiences consistently with `gh`.
This aligns the `cli/cli` behavior of IsTenancy and IsEnterprise with the counterparts here.
@andyfeller
Copy link
Contributor Author

From @williammartin:

With the addition of normalizeHostname to IsTenancy and IsEnterprise it looks like maybe there could be a few more test cases like api.tenant.ghe.com or api.github.com or api.github.localhost

Including API cases for tenancy checks, ensuring that hosts are normalized.
Adding API hosts to TestIsEnterprise to ensure that normalized hosts work as expected.
Copy link
Member

@williammartin williammartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

@andyfeller andyfeller merged commit 5840c44 into trunk Apr 29, 2024
10 checks passed
@andyfeller andyfeller deleted the andyfeller/export-auth-is-tenancy branch April 29, 2024 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants