crates/server: enhance auth middleware and error responses
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I48a780779d884c4a7730347f920b91216a6a6964
This commit is contained in:
parent
000fb8994f
commit
92153bf9aa
8 changed files with 272 additions and 99 deletions
|
|
@ -45,16 +45,19 @@ async fn shutdown_signal() {
|
|||
|
||||
#[tokio::main]
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
tracing_subscriber::fmt::init();
|
||||
let config = Config::load()?;
|
||||
fc_common::init_tracing(&config.tracing);
|
||||
|
||||
let cli = Cli::parse();
|
||||
let config = Config::load()?;
|
||||
|
||||
let host = cli.host.unwrap_or(config.server.host.clone());
|
||||
let port = cli.port.unwrap_or(config.server.port);
|
||||
|
||||
let db = Database::new(config.database.clone()).await?;
|
||||
|
||||
// Bootstrap declarative projects, jobsets, and API keys from config
|
||||
fc_common::bootstrap::run(db.pool(), &config.declarative).await?;
|
||||
|
||||
let state = AppState {
|
||||
pool: db.pool().clone(),
|
||||
config: config.clone(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue