5 Commits

Author SHA1 Message Date
ba7e966446 Reject duplicate service token on create
Some checks failed
Build docker image / Build-Docker-Image (push) Has been cancelled
rust-clippy analyze / Run rust-clippy analyzing (push) Has been cancelled
2025-10-25 19:45:08 +02:00
bdfa94cb15 Merge pull request #39 from flibusta-apps/dependabot/github_actions/github/codeql-action-4
Some checks failed
Build docker image / Build-Docker-Image (push) Has been cancelled
rust-clippy analyze / Run rust-clippy analyzing (push) Has been cancelled
Bump github/codeql-action from 3 to 4
2025-10-14 17:49:05 +02:00
dependabot[bot]
9855d967b5 Bump github/codeql-action from 3 to 4
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3 to 4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-08 10:05:44 +00:00
fcc165ac9c Merge pull request #37 from flibusta-apps/dependabot/github_actions/actions/checkout-5
Some checks failed
Build docker image / Build-Docker-Image (push) Has been cancelled
rust-clippy analyze / Run rust-clippy analyzing (push) Has been cancelled
Bump actions/checkout from 4 to 5
2025-09-10 17:06:59 +02:00
dependabot[bot]
f2dd89e6ab Bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-18 15:18:31 +00:00
2 changed files with 17 additions and 2 deletions

View File

@@ -28,7 +28,7 @@ jobs:
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v5
- name: Install Rust toolchain - name: Install Rust toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1 uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1
@@ -49,7 +49,7 @@ jobs:
continue-on-error: true continue-on-error: true
- name: Upload analysis results to GitHub - name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v3 uses: github/codeql-action/upload-sarif@v4
with: with:
sarif_file: rust-clippy-results.sarif sarif_file: rust-clippy-results.sarif
wait-for-processing: true wait-for-processing: true

View File

@@ -113,6 +113,21 @@ async fn create_service(db: Database, Json(data): Json<CreateServiceData>) -> im
return StatusCode::PAYMENT_REQUIRED.into_response(); return StatusCode::PAYMENT_REQUIRED.into_response();
}; };
let token_exists = sqlx::query_scalar!(
r#"
SELECT EXISTS(SELECT 1 FROM services WHERE token = $1)
"#,
token
)
.fetch_one(&db.0)
.await
.unwrap_or(Some(false))
.unwrap();
if token_exists {
return StatusCode::CONFLICT.into_response();
}
let service = sqlx::query_as!( let service = sqlx::query_as!(
Service, Service,
r#" r#"