Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: rename oauth-api to oauth-refresh #18

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "oauth-api"
name = "oauth-refresh"
version = "0.1.0"
edition = "2021"

Expand Down Expand Up @@ -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]
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -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()?;
Expand Down
2 changes: 1 addition & 1 deletion tests/http/trigger.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
4 changes: 2 additions & 2 deletions tests/suite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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();
Expand Down
Loading