From c8f12f537f5f1cbe8404c7c2e1c933f91db466db Mon Sep 17 00:00:00 2001 From: Peter Kuczera Date: Fri, 30 Aug 2024 17:27:18 -0400 Subject: [PATCH] chore: rename oauth-api to oauth-refresh --- Cargo.lock | 2 +- Cargo.toml | 4 ++-- Dockerfile | 12 ++++++------ README.md | 2 +- src/main.rs | 4 ++-- tests/http/trigger.rs | 2 +- tests/suite.rs | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a5fb500..1188c3b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2061,7 +2061,7 @@ dependencies = [ ] [[package]] -name = "oauth-api" +name = "oauth-refresh" version = "0.1.0" dependencies = [ "actix", diff --git a/Cargo.toml b/Cargo.toml index 914d3e7..84ed48c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "oauth-api" +name = "oauth-refresh" version = "0.1.0" edition = "2021" @@ -40,7 +40,7 @@ tracing-subscriber = { version = "0.3.18", features = ["registry", "env-filter"] path = "src/lib.rs" [[bin]] -name = "oauth-api" +name = "oauth-refresh" path = "src/main.rs" [dev-dependencies] diff --git a/Dockerfile b/Dockerfile index bfa8359..1f347e3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,20 @@ FROM lukemathwalker/cargo-chef:latest-rust-1.77.0 AS chef -WORKDIR /app/oauth-api +WORKDIR /app/oauth-refresh FROM chef AS planner COPY . . RUN cargo chef prepare --recipe-path recipe.json FROM chef AS builder -COPY --from=planner /app/oauth-api/recipe.json recipe.json +COPY --from=planner /app/oauth-refresh/recipe.json recipe.json # Build dependencies - this is the caching Docker layer! -RUN cargo chef cook --release --recipe-path recipe.json --bin oauth-api +RUN cargo chef cook --release --recipe-path recipe.json --bin oauth-refresh # Build application COPY . . -RUN cargo build --release --bin oauth-api +RUN cargo build --release --bin oauth-refresh FROM debian:bookworm-slim AS runtime RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/* WORKDIR /app -COPY --from=builder /app/oauth-api/target/release/oauth-api /usr/local/bin -ENTRYPOINT /usr/local/bin/oauth-api +COPY --from=builder /app/oauth-refresh/target/release/oauth-refresh /usr/local/bin +ENTRYPOINT /usr/local/bin/oauth-refresh diff --git a/README.md b/README.md index ff1b968..7d6cef9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -# OAuth API +# OAuth Refresh This is an API that uses OAuth2.0 blueprints to both refresh tokens and trigger the authorization code flow. diff --git a/src/main.rs b/src/main.rs index 5d2dde6..9fc9562 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,13 +1,13 @@ use dotenvy::dotenv; use envconfig::Envconfig; use integrationos_domain::telemetry::{get_subscriber, init_subscriber}; -use oauth_api::{Application, Configuration}; +use oauth_refresh::{Application, Configuration}; #[actix_web::main] async fn main() -> anyhow::Result<()> { dotenv().ok(); - let suscriber = get_subscriber("oauth_api".into(), "info".into(), std::io::stdout); + let suscriber = get_subscriber("oauth_refresh".into(), "info".into(), std::io::stdout); init_subscriber(suscriber); let configuration = Configuration::init_from_env()?; diff --git a/tests/http/trigger.rs b/tests/http/trigger.rs index 55360cf..ccf598d 100644 --- a/tests/http/trigger.rs +++ b/tests/http/trigger.rs @@ -1,7 +1,7 @@ use crate::suite::TestApp; use integrationos_domain::{prefix::IdPrefix, Id}; use mark_flaky_tests::flaky; -use oauth_api::{Token, TokenExt}; +use oauth_refresh::{Token, TokenExt}; use reqwest::header::{HeaderMap, HeaderName, HeaderValue}; use std::collections::HashMap; use uuid::Uuid; diff --git a/tests/suite.rs b/tests/suite.rs index 4f6355f..76be747 100644 --- a/tests/suite.rs +++ b/tests/suite.rs @@ -7,7 +7,7 @@ use integrationos_domain::{ AccessKey, Id, Store, }; use mongodb::{Client as MongoClient, Database}; -use oauth_api::Configuration; +use oauth_refresh::Configuration; use once_cell::sync::Lazy; use rand::Rng; use reqwest::{header::HeaderMap, Client}; @@ -69,7 +69,7 @@ impl TestApp { pub async fn spawn(config: HashMap<&str, &str>) -> Self { use std::collections::hash_map::RandomState; - use oauth_api::Application; + use oauth_refresh::Application; let url = "mongodb://127.0.0.1:27017/?directConnection=true"; let uuid = Uuid::new_v4().to_string();