Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

feat: CLI authentication — login, token storage, auto-refresh

オープン
#86 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
go

調査の方向性

Start by reviewing the previous auth/oidc package referenced in salt evolution PR #85 and the integration points in salt/cli. Define how LoginCmd, LogoutCmd, Token, Client, secure token storage, refresh, and the PKCE flow fit together. Done means the five listed components are implemented as a usable CLI authentication package.

索引モデルが issue の本文から書いたものです。

説明

Context

The current auth/oidc package provides only the OIDC/PKCE browser flow for token acquisition. It's incomplete — no token storage, no refresh, no HTTP client integration. No raystack project uses it.

Meanwhile, every raystack CLI (frontier, compass, guardian) connects to APIs without authentication, which only works in development/trusted environments. Production APIs require auth, and CLIs have no way to authenticate.

Proposed solution

A complete CLI auth package following the pattern of gh auth login, gcloud auth login, and terraform login:

// Login — opens browser, does OIDC, stores token
auth.Login(ctx, auth.Config{
    Issuer:       "https://accounts.google.com",
    ClientID:     "...",
    RedirectURL:  "http://localhost:5454",
})

// Token — reads stored token, refreshes if expired
token, err := auth.Token(ctx)

// Client — returns http.Client that auto-attaches the token
client := auth.Client(ctx)
Components
  1. Token acquisition — browser-based OIDC with PKCE (existing code from dropped auth/oidc)
  2. Token storage — secure local storage at ~/.config/raystack/<app>/token.json
  3. Token refresh — auto-refresh expired tokens using refresh_token
  4. HTTP client — http.RoundTripper that reads stored token and attaches to requests
  5. CLI commands — LoginCmd() and LogoutCmd() for easy integration with cli.Execute()
Integration with salt/cli
cli.Execute(
    cli.Name("frontier"),
    cli.Commands(
        auth.LoginCmd(authConfig),
        auth.LogoutCmd(),
        userCmd, groupCmd,
    ),
)

// In commands:
func newListCmd() *cobra.Command {
    return &cobra.Command{
        RunE: func(cmd *cobra.Command, args []string) error {
            client := auth.Client(cmd)
            // make authenticated API calls
        },
    }
}
References
主要言語
Go
スター
14
フォーク
8
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

raystack/salt のほかの issue

raystack/salt の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。