Agent Mesh
Go a2aa2a-protocolagent-meshagentic-aiinferencemcpmeshmesh-networknetwork-securitynetworking-aip2p-network
fix(auth): address PR review feedback on headless mode and device callback
Antonio Ojeac2dd0ee245ed
diff --git a/.github/k8s/dex-config.yaml b/.github/k8s/dex-config.yamlindex aef87e90..582fc37e 100644--- a/.github/k8s/dex-config.yaml+++ b/.github/k8s/dex-config.yaml@@ -53,5 +53,4 @@ data:- 'http://127.0.0.1/callback'- 'http://localhost/callback'- 'https://auth.sam-mesh.dev/device/callback'- - '/device/callback'- 'urn:ietf:wg:oauth:2.0:oob'diff --git a/cmd/sam-node/oidc.go b/cmd/sam-node/oidc.goindex bdeea95d..8f06a4b3 100644--- a/cmd/sam-node/oidc.go+++ b/cmd/sam-node/oidc.go@@ -83,7 +83,7 @@ func (n *SamNode) InteractiveLogin(ctx context.Context, authURL, tokenURL, clienreturn "", fmt.Errorf("failed to generate PKCE: %w", err)}- isHeadless := headlessFlag || os.Getenv("SSH_CLIENT") != "" || os.Getenv("SSH_TTY") != "" || isRunningInContainer()+ isHeadless := headlessFlag || os.Getenv("SSH_CLIENT") != "" || os.Getenv("SSH_TTY") != ""var redirectURI stringvar listener net.Listener@@ -333,22 +333,6 @@ func (n *SamNode) DiscoverEndpoints(ctx context.Context, issuerURL string) (tokereturn claims.TokenURL, claims.AuthURL, nil}-func isRunningInContainer() bool {- if _, err := os.Stat("/.dockerenv"); err == nil {- return true- }- if _, err := os.Stat("/run/.containerenv"); err == nil {- return true- }- if b, err := os.ReadFile("/proc/1/cgroup"); err == nil {- s := string(b)- if strings.Contains(s, "docker") || strings.Contains(s, "containerd") {- return true- }- }- return false-}-var openBrowserFunc = openBrowserfunc openBrowser(targetURL string) {