Skip to content
Merged
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
42 changes: 19 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: CI

# This repository is only the Heroku deployment wrapper for localthought.io.
# The proxy itself, and its tests (including the PostgreSQL-backed ones), live
# in ontola/atomic-plugins' integration-proxy/ and run in that repo's CI. Here
# we only check that the wrapper builds from the committed Cargo.lock, which is
# exactly what Heroku deploys.

on:
push:
branches: [main]
Expand All @@ -9,25 +15,8 @@ env:
CARGO_TERM_COLOR: always

jobs:
test:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: connect_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-timeout 5s
--health-retries 10
env:
OAUTH_GITHUB_ISSUES_CLIENT_ID: fixture-client
OAUTH_GITHUB_ISSUES_CLIENT_SECRET: fixture-secret
TEST_DATABASE_URL: postgres://postgres@localhost:5432/connect_test?sslmode=disable
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
Expand All @@ -37,8 +26,15 @@ jobs:
- name: Check formatting
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Build
run: cargo build --all-targets
- name: Test
run: cargo test -- --include-ignored
run: cargo clippy --locked --all-targets -- -D warnings
- name: Build (release, as Heroku does)
run: cargo build --locked --release
- name: Binary exits with a configuration error when unconfigured
run: |
set +e
output=$(env -i PATH="$PATH" ./target/release/auth-proxy 2>&1)
status=$?
set -e
echo "$output"
test "$status" -ne 0
echo "$output" | grep -q '^configuration error: '
102 changes: 0 additions & 102 deletions AGENTS.md

This file was deleted.

24 changes: 16 additions & 8 deletions Cargo.lock

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

43 changes: 17 additions & 26 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,37 +1,28 @@
# Deployment wrapper for localthought.io (Heroku). All proxy code lives in the
# `atomic-integration-proxy` crate, developed in
# https://github.com/ontola/atomic-plugins/tree/main/integration-proxy; this
# package is the template from that repo's
# integration-proxy/examples/heroku-wrapper/.
#
# The package and binary stay named `auth-proxy` so the existing
# `web: target/release/auth-proxy` Procfile line keeps working unchanged.
[package]
name = "auth-proxy"
version = "0.1.0"
edition = "2021"
description = "Stateless Rust auth proxy with Google login"
license = "MIT"
repository = "https://github.com/localthought/auth-proxy"
publish = false

[dependencies]
axum = { version = "0.7", features = ["macros"] }
axum-extra = { version = "0.9", features = ["cookie-private"] }
tokio = { version = "1", features = ["rt-multi-thread", "macros", "signal"] }
tower-http = { version = "0.5", features = ["trace", "cors"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
oauth2 = "4"
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_yaml = "0.9"
url = "2"
rand = "0.8"
base64 = "0.22"
time = "0.3"
sha2 = "0.10"
hmac = "0.12"
tokio-postgres = "0.7"
postgres-native-tls = "0.5"
native-tls = "0.2"
chacha20poly1305 = "0.10"
# Pinned to an ontola/atomic-plugins commit because the crate is not on
# crates.io yet; cargo finds the `atomic-integration-proxy` package in that
# repo's integration-proxy/ subdirectory by name. To deploy a newer proxy,
# change `rev` and run `cargo update -p atomic-integration-proxy`.
# TODO: once `atomic-integration-proxy` is published to crates.io, replace
# this line with `atomic-integration-proxy = "0.1"` (i.e. `version = "0.1"`).
atomic-integration-proxy = { git = "https://github.com/ontola/atomic-plugins", rev = "494eb8af139b60a41e5197c92053890c0d841b2f" }
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }

[profile.release]
opt-level = 3
lto = true

[dev-dependencies]
tower = { version = "0.5", features = ["util"] }
Loading
Loading