feat(admin): create and list users commands
This commit is contained in:
parent
8d20cab18f
commit
a0de3b287b
19 changed files with 314 additions and 30 deletions
|
|
@ -14,6 +14,7 @@ strum = { workspace = true }
|
|||
strum_macros = { workspace = true }
|
||||
|
||||
anyhow = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
fully_pub = { workspace = true }
|
||||
|
||||
tokio = { workspace = true }
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ pub mod token_claims;
|
|||
|
||||
use fully_pub::fully_pub;
|
||||
use anyhow::{Result, Context};
|
||||
use kernel::{context::AppSecrets, models::config::Config, repositories::storage::Storage};
|
||||
use kernel::{context::{AppSecrets, KernelContext}, models::config::Config, repositories::storage::Storage};
|
||||
use log::info;
|
||||
use minijinja::Environment;
|
||||
|
||||
|
|
@ -38,16 +38,14 @@ pub struct AppState {
|
|||
|
||||
pub async fn start_http_server(
|
||||
server_config: ServerConfig,
|
||||
config: Config,
|
||||
secrets: AppSecrets,
|
||||
db_pool: Storage
|
||||
ctx: KernelContext
|
||||
) -> Result<()> {
|
||||
// build state
|
||||
let state = AppState {
|
||||
templating_env: build_templating_env(&config),
|
||||
config,
|
||||
secrets,
|
||||
db: db_pool
|
||||
templating_env: build_templating_env(&ctx.config),
|
||||
config: ctx.config,
|
||||
secrets: ctx.secrets,
|
||||
db: ctx.storage
|
||||
};
|
||||
|
||||
// build routes
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ struct ServerCliFlags {
|
|||
pub async fn main() -> Result<()> {
|
||||
info!("Starting minauth");
|
||||
let flags: ServerCliFlags = argh::from_env();
|
||||
let (config, secrets, db_pool) = get_kernel_context(StartKernelConfig {
|
||||
let kernel_context = get_kernel_context(StartKernelConfig {
|
||||
config_path: flags.config,
|
||||
database_path: flags.database
|
||||
}).await.context("Getting kernel context")?;
|
||||
|
|
@ -42,8 +42,6 @@ pub async fn main() -> Result<()> {
|
|||
listen_host: flags.listen_host,
|
||||
listen_port: flags.listen_port
|
||||
},
|
||||
config,
|
||||
secrets,
|
||||
db_pool
|
||||
kernel_context
|
||||
).await
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue