feat: add credential encryption key config and improve service token CLI display
- Add CREDENTIAL_ENCRYPTION_KEY environment variable with Fernet key generation guide - Improve service token issue command to display raw token once with warning - Refactor token list display function for better UX (new print_service_token_list) - Keep backward compatibility with print_service_token_table alias
This commit is contained in:
@@ -81,10 +81,15 @@ def issue_service_token(
|
||||
runtime_id=issued.auth_token.runtime_id,
|
||||
token=issued.token,
|
||||
)
|
||||
render_service_token_result(ctx.obj.console, ctx.obj.output_format, response)
|
||||
|
||||
if ctx.obj.output_format != "json":
|
||||
ctx.obj.console.print(f"masked_token: {mask_token_text(issued.token)}")
|
||||
# 발급 시 1회에 한해 원문 token 출력 (이후 마스킹된 값만 표시됨)
|
||||
if ctx.obj.output_format == "json":
|
||||
from app.cli.core.utils import render_output
|
||||
render_output(ctx.obj.console, "json", response.model_dump(mode="json"))
|
||||
else:
|
||||
ctx.obj.console.print("[bold yellow]⚠ 토큰 원문은 지금 1회만 표시됩니다. 안전한 곳에 저장하세요.[/bold yellow]")
|
||||
ctx.obj.console.print(f"[bold green]token:[/bold green] {issued.token}")
|
||||
render_service_token_result(ctx.obj.console, ctx.obj.output_format, response)
|
||||
|
||||
|
||||
@token_app.command("revoke")
|
||||
|
||||
Reference in New Issue
Block a user