feat(auth): Add OAuth2 authentication
This commit is contained in:
23
secnex/app/utils.py
Normal file
23
secnex/app/utils.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import typer
|
||||
from typing import Optional
|
||||
|
||||
from rich.console import Console
|
||||
from rich.table import Table
|
||||
from rich.prompt import Prompt
|
||||
|
||||
import os
|
||||
import json
|
||||
|
||||
import secnex.utils as u
|
||||
|
||||
console = Console()
|
||||
|
||||
utils_app = typer.Typer()
|
||||
|
||||
@utils_app.command(name="secret", help="Generate a new secret")
|
||||
def generate_secret() -> str:
|
||||
"""Generate a new secret"""
|
||||
secret = u.generate_secret()
|
||||
console.print(f"Secret: {secret}")
|
||||
console.print(f"Hash: {u.hash_secret(secret)}")
|
||||
return secret
|
||||
Reference in New Issue
Block a user