feat: add token file and env Login

This commit is contained in:
2026-09-01 11:53:16 -05:00
parent 076c8c81b8
commit 3983d0b335
5 changed files with 170 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
package auth_test
import (
"os"
"path/filepath"
"testing"
"s1d3sw1ped/robinhood-agentic-mcp/auth"
)
func TestWriteTokensMode(t *testing.T) {
t.Parallel()
path := filepath.Join(t.TempDir(), "tokens.json")
if err := auth.WriteTokens(path, "abc", ""); err != nil {
t.Fatal(err)
}
st, err := os.Stat(path)
if err != nil {
t.Fatal(err)
}
if st.Mode().Perm() != 0o600 {
t.Fatalf("perm %o", st.Mode().Perm())
}
}