Skip to content

Commit c9c3742

Browse files
committed
Remove Postgres auth backend
1 parent 4ab70fa commit c9c3742

File tree

18 files changed

+13
-348
lines changed

18 files changed

+13
-348
lines changed

.github/workflows/on-push.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
with:
5252
tool: cargo-hack@0.6.6
5353
- uses: Swatinem/rust-cache@v2
54-
- run: cargo hack --verbose check --feature-powerset --depth=3 --at-least-one-of=postgresql-index-backend,filesystem-index-backend --at-least-one-of=postgresql-auth-backend,filesystem-auth-backend --no-dev-deps --workspace
54+
- run: cargo hack --verbose check --feature-powerset --depth=3 --at-least-one-of=postgresql-index-backend,filesystem-index-backend -F filesystem-auth-backend --ignore-unknown-features --no-dev-deps --workspace
5555

5656
clippy:
5757
runs-on: ubuntu-latest
@@ -79,7 +79,7 @@ jobs:
7979
with:
8080
tool: cargo-hack@0.6.6
8181
- uses: Swatinem/rust-cache@v2
82-
- run: cargo hack --verbose test --features=postgresql-index-backend,postgresql-auth-backend --ignore-unknown-features --each-feature --exclude-features test_e2e --workspace
82+
- run: cargo hack --verbose test --features=postgresql-index-backend --ignore-unknown-features --each-feature --exclude-features test_e2e --workspace
8383

8484
minimal-versions:
8585
runs-on: ubuntu-latest

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,12 @@ If you want to contribute a user interface for Freighter, PRs are welcome!
3838

3939
To try out Freighter **locally**, start a `postgres:14` server:
4040
```
41-
docker run -it -e POSTGRES_USER=freighter -e POSTGRES_PASSWORD=crates-crates-crates -p 5432:5432 -v /data:/var/lib/postgresql/data postgres:14
41+
docker run -it -e POSTGRES_USER=freighter -e POSTGRES_PASSWORD=crates-crates-crates -p 5432:5432 -v /var/tmp/data:/var/lib/postgresql/data postgres:14
4242
```
4343

4444
Run the migrations, e.g. with a locally installed `psql`:
4545
```
4646
PGPASSWORD=crates-crates-crates psql -U freighter -h localhost -f sql/init-index-db.sql
47-
PGPASSWORD=crates-crates-crates psql -U freighter -h localhost -f sql/init-auth-db.sql
4847
```
4948

5049
Next, we need an S3-compatible server. You can use an S3 emulator for testing purposes:
@@ -60,8 +59,8 @@ service:
6059
download_endpoint: "http://127.0.0.1:3000/downloads/{crate}/{version}"
6160
api_endpoint: "http://127.0.0.1:3000"
6261

63-
# for postgres backend
64-
index_db: &db
62+
# for postgres index backend
63+
index_db:
6564
dbname: "freighter"
6665
user: "freighter"
6766
password: "crates-crates-crates"
@@ -71,8 +70,6 @@ index_db: &db
7170
# for filesystem backend
7271
index_path: "/var/lib/freighter/index"
7372

74-
auth_db: *db
75-
7673
store:
7774
name: "crates"
7875
endpoint_url: "http://127.0.0.1:9090"

crates/freighter-auth/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ all-features = true
1616
rustdoc-args = ["--cfg", "docsrs"]
1717

1818
[features]
19-
default = ["pg-backend"]
2019
yes-backend = []
21-
pg-backend = ["dep:deadpool-postgres", "dep:tokio"]
2220
fs-backend = ["dep:base64", "dep:serde_json", "dep:parking_lot", "dep:tempfile", "dep:hmac"]
2321
cf-backend = ["dep:jsonwebtoken", "dep:reqwest", "dep:serde_json", "dep:tokio", "dep:cookie"]
2422

@@ -29,7 +27,6 @@ anyhow = { workspace = true }
2927
async-trait = { workspace = true }
3028
axum = { workspace = true }
3129
cookie = { version = "0.18.1", optional = true }
32-
deadpool-postgres = { workspace = true, optional = true }
3330
http = "1.1.0"
3431
jsonwebtoken = { version = "9.3.0", optional = true }
3532
rand = { workspace = true }

crates/freighter-auth/sql/add-owner.sql

Lines changed: 0 additions & 3 deletions
This file was deleted.

crates/freighter-auth/sql/auth-crate-action.sql

Lines changed: 0 additions & 5 deletions
This file was deleted.

crates/freighter-auth/sql/get-user-for-token.sql

Lines changed: 0 additions & 4 deletions
This file was deleted.

crates/freighter-auth/sql/get-user-id.sql

Lines changed: 0 additions & 3 deletions
This file was deleted.

crates/freighter-auth/sql/list-owners.sql

Lines changed: 0 additions & 4 deletions
This file was deleted.

crates/freighter-auth/sql/login.sql

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)