Skip to main content

josh_github_auth/
lib.rs

1pub mod app_flow;
2pub mod device_flow;
3pub mod middleware;
4
5pub const APP_CLIENT_ID: &str = "Ov23lijvAWwDiQDwZGhN";
6
7// Matches official github CLI and other github-adjacent tools
8pub const GITHUB_USER_TOKEN_ENV: &str = "GH_TOKEN";
9
10/// Check if the given URL is a GitHub URL.
11pub fn is_github_url(url: &str) -> bool {
12    url::Url::parse(url)
13        .ok()
14        .and_then(|u| {
15            u.host_str()
16                .map(|h| h == "github.com" || h.ends_with(".github.com"))
17        })
18        .unwrap_or(false)
19}