Compare commits

...

38 Commits

Author SHA1 Message Date
93ca002dc0 Version bump
All checks were successful
Release Tagging / release (pull_request) Successful in 37s
Rust Build / Check (pull_request) Successful in 1m8s
Rust Build / Test Suite (pull_request) Successful in 1m4s
Rust Build / Rustfmt (pull_request) Successful in 33s
Rust Build / build (pull_request) Successful in 51s
Rust Build / Clippy (pull_request) Successful in 58s
2025-10-12 16:36:42 -04:00
daaa224eee Updated rust version in workflows and cargo 2025-10-12 16:35:52 -04:00
4e649fa390 Dependency update (#69)
All checks were successful
Rust Build / Check (push) Successful in 33s
Rust Build / Rustfmt (push) Successful in 32s
Rust Build / Test Suite (push) Successful in 1m13s
Rust Build / Clippy (push) Successful in 40s
Rust Build / build (push) Successful in 50s
Reviewed-on: #69
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-10-12 20:34:46 +00:00
668d371f7f Merge pull request 'Coverart changes' (#65) from coverart_changes into main
All checks were successful
Rust Build / Check (push) Successful in 32s
Rust Build / Rustfmt (push) Successful in 32s
Rust Build / Clippy (push) Successful in 31s
Rust Build / build (push) Successful in 31s
Rust Build / Test Suite (push) Successful in 33s
Release Tagging / release (pull_request) Successful in 31s
Rust Build / Check (pull_request) Successful in 30s
Rust Build / Test Suite (pull_request) Successful in 12m55s
Rust Build / Rustfmt (pull_request) Successful in 26m11s
Rust Build / Clippy (pull_request) Successful in 36s
Rust Build / build (pull_request) Successful in 35s
Reviewed-on: #65
2025-10-11 22:18:24 +00:00
eac7562b80 Coverart remove file (#68)
All checks were successful
Release Tagging / release (pull_request) Successful in 31s
Rust Build / Check (pull_request) Successful in 31s
Rust Build / Test Suite (pull_request) Successful in 34s
Rust Build / Rustfmt (pull_request) Successful in 32s
Rust Build / Clippy (pull_request) Successful in 33s
Rust Build / build (pull_request) Successful in 31s
Reviewed-on: #68
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-10-11 22:14:10 +00:00
e3ca2c5781 Coverart save to filesystem (#67)
All checks were successful
Release Tagging / release (pull_request) Successful in 36s
Rust Build / Check (pull_request) Successful in 41s
Rust Build / Test Suite (pull_request) Successful in 43s
Rust Build / Rustfmt (pull_request) Successful in 32s
Rust Build / Clippy (pull_request) Successful in 2m12s
Rust Build / build (pull_request) Successful in 2m18s
Reviewed-on: #67
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-10-11 20:30:39 +00:00
440caca7c2 Moved to_data (#66)
Some checks failed
Rust Build / Check (pull_request) Successful in 33s
Release Tagging / release (pull_request) Successful in 36s
Rust Build / Test Suite (pull_request) Successful in 45s
Rust Build / Rustfmt (pull_request) Successful in 33s
Rust Build / Clippy (pull_request) Failing after 44s
Rust Build / build (pull_request) Successful in 1m7s
Reviewed-on: #66
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-10-11 20:11:39 +00:00
0c0b4ba7ca Merge pull request 'Song changes' (#60) from song_changes into main
Some checks failed
Rust Build / Check (push) Successful in 30s
Rust Build / Rustfmt (push) Successful in 33s
Rust Build / Test Suite (push) Successful in 39s
Rust Build / Clippy (push) Failing after 36s
Rust Build / build (push) Successful in 35s
Rust Build / Check (pull_request) Successful in 32s
Release Tagging / release (pull_request) Failing after 36s
Rust Build / Test Suite (pull_request) Successful in 34s
Rust Build / Rustfmt (pull_request) Successful in 32s
Rust Build / build (pull_request) Successful in 31s
Rust Build / Clippy (pull_request) Failing after 34s
Reviewed-on: #60
2025-10-11 19:49:52 +00:00
c263cedf28 Remove song (#64)
Some checks failed
Release Tagging / release (pull_request) Successful in 33s
Rust Build / Check (pull_request) Successful in 43s
Rust Build / Test Suite (pull_request) Successful in 44s
Rust Build / Rustfmt (pull_request) Successful in 32s
Rust Build / Clippy (pull_request) Failing after 32s
Rust Build / build (pull_request) Successful in 38s
Reviewed-on: #64
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-10-11 19:46:00 +00:00
0637a9432e Changes to how song filenames are generated (#63)
Some checks failed
Rust Build / Test Suite (pull_request) Successful in 35s
Rust Build / Check (pull_request) Successful in 38s
Release Tagging / release (pull_request) Successful in 48s
Rust Build / Rustfmt (pull_request) Failing after 33s
Rust Build / Clippy (pull_request) Successful in 34s
Rust Build / build (pull_request) Successful in 35s
Reviewed-on: #63
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-10-11 19:20:57 +00:00
d7c078d95a Song to_data change (#62)
All checks were successful
Rust Build / Check (pull_request) Successful in 35s
Release Tagging / release (pull_request) Successful in 43s
Rust Build / Test Suite (pull_request) Successful in 46s
Rust Build / Rustfmt (pull_request) Successful in 33s
Rust Build / build (pull_request) Successful in 33s
Rust Build / Clippy (pull_request) Successful in 50s
Reviewed-on: #62
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-10-11 19:02:01 +00:00
00cada74e2 Copy song (#61)
Some checks failed
Rust Build / Check (pull_request) Successful in 42s
Release Tagging / release (pull_request) Successful in 44s
Rust Build / Test Suite (pull_request) Failing after 1m2s
Rust Build / Rustfmt (pull_request) Successful in 30s
Rust Build / Clippy (pull_request) Successful in 36s
Rust Build / build (pull_request) Successful in 50s
Reviewed-on: #61
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-10-11 18:53:13 +00:00
9436c9033a Added todo
All checks were successful
Release Tagging / release (pull_request) Successful in 44s
Rust Build / Test Suite (pull_request) Successful in 49s
Rust Build / Check (pull_request) Successful in 57s
Rust Build / Rustfmt (pull_request) Successful in 29s
Rust Build / Clippy (pull_request) Successful in 47s
Rust Build / build (pull_request) Successful in 59s
2025-10-11 14:23:23 -04:00
85d8f839f1 Code formatting
All checks were successful
Rust Build / Test Suite (pull_request) Successful in 1m38s
Rust Build / Rustfmt (pull_request) Successful in 32s
Release Tagging / release (pull_request) Successful in 2m17s
Rust Build / Check (pull_request) Successful in 2m30s
Rust Build / Clippy (pull_request) Successful in 57s
Rust Build / build (pull_request) Successful in 1m1s
2025-10-11 14:19:45 -04:00
16f633d563 Added test 2025-10-11 14:19:30 -04:00
0b53eb8208 Added more todos 2025-10-11 14:19:21 -04:00
73c8fd2634 Tweaked some changes 2025-10-11 14:17:32 -04:00
fa8643e73a Added function to save song to the filesystem 2025-10-11 14:08:20 -04:00
2d6b550ae6 tsk-57: Adding derive Schema to models (#58)
All checks were successful
Rust Build / Check (push) Successful in 31s
Rust Build / Test Suite (push) Successful in 1m0s
Rust Build / Rustfmt (push) Successful in 31s
Rust Build / Clippy (push) Successful in 37s
Rust Build / build (push) Successful in 46s
Closes #57

Reviewed-on: #58
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-08-24 23:42:04 +00:00
f43bcaa314 Merge pull request 'Release' (#50) from devel into main
All checks were successful
Rust Build / Test Suite (push) Successful in 35s
Rust Build / Rustfmt (push) Successful in 1s
Rust Build / Check (push) Successful in 14s
Rust Build / build (push) Successful in 9s
Rust Build / Clippy (push) Successful in 52s
Reviewed-on: #50
2025-08-17 18:36:04 +00:00
a6ef7d8a62 Removed devel branch references (#56)
All checks were successful
Release Tagging / release (pull_request) Successful in 10s
Rust Build / Check (pull_request) Successful in 12s
Rust Build / Test Suite (pull_request) Successful in 1m3s
Rust Build / Rustfmt (pull_request) Successful in -6s
Rust Build / Clippy (pull_request) Successful in 9s
Rust Build / build (pull_request) Successful in 53s
Reviewed-on: #56
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-08-17 18:31:05 +00:00
bd793db08e Add Id to token (#55)
All checks were successful
Release Tagging / release (push) Successful in 39s
Rust Build / Check (push) Successful in 41s
Rust Build / Rustfmt (push) Successful in 36s
Rust Build / Test Suite (push) Successful in 37s
Rust Build / Clippy (push) Successful in 33s
Rust Build / build (push) Successful in 34s
Rust Build / Test Suite (pull_request) Successful in 31s
Rust Build / Check (pull_request) Successful in 33s
Rust Build / Clippy (pull_request) Successful in 31s
Rust Build / Rustfmt (pull_request) Successful in 32s
Rust Build / build (pull_request) Successful in 41s
Reviewed-on: #55
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-08-06 22:45:32 +00:00
1e95822b5a tsk-51: Do not serialize path field for CoverArt (#54)
All checks were successful
Rust Build / Check (push) Successful in 30s
Release Tagging / release (push) Successful in 33s
Rust Build / Test Suite (push) Successful in 32s
Rust Build / Rustfmt (push) Successful in 31s
Rust Build / build (push) Successful in 27s
Rust Build / Clippy (push) Successful in 32s
Rust Build / Test Suite (pull_request) Successful in 30s
Rust Build / Check (pull_request) Successful in 27s
Rust Build / Rustfmt (pull_request) Successful in 30s
Rust Build / Clippy (pull_request) Successful in 38s
Rust Build / build (pull_request) Successful in 28s
Reviewed-on: #54
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-08-01 20:18:09 +00:00
228ca67a16 Create token refactor (#53)
All checks were successful
Rust Build / Check (push) Successful in 29s
Release Tagging / release (push) Successful in 31s
Rust Build / Test Suite (push) Successful in 29s
Rust Build / Rustfmt (push) Successful in 30s
Rust Build / Clippy (push) Successful in 27s
Rust Build / build (push) Successful in 32s
Rust Build / Check (pull_request) Successful in 25s
Rust Build / Test Suite (pull_request) Successful in 32s
Rust Build / Rustfmt (pull_request) Successful in 25s
Rust Build / Clippy (pull_request) Successful in 32s
Rust Build / build (pull_request) Successful in 30s
Reviewed-on: #53
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-08-01 20:04:33 +00:00
d3251f935e add create token function (#52)
All checks were successful
Rust Build / Check (push) Successful in 31s
Release Tagging / release (push) Successful in 35s
Rust Build / Rustfmt (push) Successful in 30s
Rust Build / Test Suite (push) Successful in 40s
Rust Build / Clippy (push) Successful in 32s
Rust Build / build (push) Successful in 30s
Rust Build / Check (pull_request) Successful in 36s
Rust Build / Test Suite (pull_request) Successful in 44s
Rust Build / Rustfmt (pull_request) Successful in 26s
Rust Build / build (pull_request) Successful in 30s
Rust Build / Clippy (pull_request) Successful in 45s
Reviewed-on: #52
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-07-31 01:13:02 +00:00
1c5de9dc26 coverart add song_id (#49)
All checks were successful
Rust Build / Check (push) Successful in 26s
Release Tagging / release (push) Successful in 32s
Rust Build / Test Suite (push) Successful in 32s
Rust Build / Rustfmt (push) Successful in 29s
Rust Build / Clippy (push) Successful in 28s
Rust Build / build (push) Successful in 29s
Rust Build / Test Suite (pull_request) Successful in 26s
Rust Build / Check (pull_request) Successful in 30s
Rust Build / Rustfmt (pull_request) Successful in 27s
Rust Build / Clippy (pull_request) Successful in 32s
Rust Build / build (pull_request) Successful in 34s
Reviewed-on: #49
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-07-26 16:35:51 +00:00
569fb632e5 Merge pull request 'v0.5.X release' (#41) from devel into main
All checks were successful
Rust Build / Check (push) Successful in 26s
Rust Build / Test Suite (push) Successful in 30s
Rust Build / Rustfmt (push) Successful in 30s
Rust Build / Clippy (push) Successful in 31s
Rust Build / build (push) Successful in 27s
Reviewed-on: #41
2025-07-23 21:59:40 +00:00
7839c64561 Version bump (#48)
All checks were successful
Release Tagging / release (push) Successful in 28s
Rust Build / Check (push) Successful in 28s
Rust Build / Test Suite (push) Successful in 27s
Rust Build / Rustfmt (push) Successful in 25s
Rust Build / Clippy (push) Successful in 27s
Rust Build / build (push) Successful in 30s
Rust Build / Check (pull_request) Successful in 27s
Rust Build / Test Suite (pull_request) Successful in 26s
Rust Build / Rustfmt (pull_request) Successful in 26s
Rust Build / Clippy (pull_request) Successful in 26s
Rust Build / build (pull_request) Successful in 25s
Reviewed-on: #48
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-07-23 21:54:10 +00:00
655d05dabb Coverart ignore data for json usage (#47)
All checks were successful
Release Tagging / release (push) Successful in 30s
Rust Build / Check (push) Successful in 25s
Rust Build / Test Suite (push) Successful in 27s
Rust Build / Rustfmt (push) Successful in 26s
Rust Build / Clippy (push) Successful in 28s
Rust Build / build (push) Successful in 27s
Rust Build / Check (pull_request) Successful in 29s
Rust Build / Test Suite (pull_request) Successful in 28s
Rust Build / Rustfmt (pull_request) Successful in 25s
Rust Build / Clippy (pull_request) Successful in 27s
Rust Build / build (pull_request) Successful in 29s
Reviewed-on: #47
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-07-14 23:57:00 +00:00
7958b89abc Update readme (#46)
All checks were successful
Release Tagging / release (push) Successful in 30s
Rust Build / Check (push) Successful in 26s
Rust Build / Test Suite (push) Successful in 28s
Rust Build / Rustfmt (push) Successful in 27s
Rust Build / Clippy (push) Successful in 29s
Rust Build / build (push) Successful in 27s
Rust Build / Check (pull_request) Successful in 38s
Rust Build / Test Suite (pull_request) Successful in 40s
Rust Build / Rustfmt (pull_request) Successful in 27s
Rust Build / Clippy (pull_request) Successful in 52s
Rust Build / build (pull_request) Successful in 43s
Reviewed-on: #46
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-06-29 18:14:18 +00:00
c0d23e0640 Version bump (#45)
All checks were successful
Rust Build / Check (push) Successful in 28s
Rust Build / Test Suite (push) Successful in 29s
Rust Build / Rustfmt (push) Successful in 26s
Rust Build / Clippy (push) Successful in 26s
Rust Build / build (push) Successful in 28s
Release Tagging / release (push) Successful in 31s
Rust Build / Check (pull_request) Successful in 25s
Rust Build / Test Suite (pull_request) Successful in 27s
Rust Build / Rustfmt (pull_request) Successful in 26s
Rust Build / Clippy (pull_request) Successful in 28s
Rust Build / build (pull_request) Successful in 28s
Reviewed-on: #45
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-06-29 18:02:23 +00:00
1a64b512f4 Removing some code (#44)
All checks were successful
Release Tagging / release (push) Successful in 30s
Rust Build / Check (push) Successful in 28s
Rust Build / Test Suite (push) Successful in 27s
Rust Build / Rustfmt (push) Successful in 25s
Rust Build / Clippy (push) Successful in 28s
Rust Build / build (push) Successful in 27s
Rust Build / Check (pull_request) Successful in 28s
Rust Build / Test Suite (pull_request) Successful in 28s
Rust Build / Rustfmt (pull_request) Successful in 26s
Rust Build / Clippy (pull_request) Successful in 28s
Rust Build / build (pull_request) Successful in 26s
Taking out code that wasn't being used and was commented.

Reviewed-on: #44
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-06-29 17:54:23 +00:00
6aa4c3d741 Merge pull request 'Next release' (#38) from devel into main
All checks were successful
Release Tagging / release (push) Successful in 42s
Rust Build / Check (push) Successful in 33s
Rust Build / Test Suite (push) Successful in 39s
Rust Build / Rustfmt (push) Successful in 31s
Rust Build / Clippy (push) Successful in 37s
Rust Build / build (push) Successful in 30s
Rust Build / Check (pull_request) Successful in 27s
Rust Build / Test Suite (pull_request) Successful in 25s
Rust Build / Rustfmt (pull_request) Successful in 25s
Rust Build / Clippy (pull_request) Successful in 27s
Rust Build / build (pull_request) Successful in 26s
Reviewed-on: #38
2025-04-10 23:49:19 +00:00
97853a42c1 Merge pull request 'workflow_tag_fix (#33)' (#34) from devel into main
All checks were successful
Release Tagging / release (push) Successful in 32s
Rust Build / Check (push) Successful in 28s
Rust Build / Test Suite (push) Successful in 32s
Rust Build / Rustfmt (push) Successful in 32s
Rust Build / Clippy (push) Successful in 30s
Rust Build / build (push) Successful in 33s
Reviewed-on: #34
2025-04-07 01:09:43 +00:00
fdae8056b1 Merge pull request 'Next release' (#30) from devel into main
All checks were successful
Rust Build / Check (push) Successful in 30s
Rust Build / Test Suite (push) Successful in 35s
Rust Build / Rustfmt (push) Successful in 29s
Rust Build / Clippy (push) Successful in 30s
Rust Build / build (push) Successful in 30s
Release Tagging / release (push) Successful in 34s
Reviewed-on: #30
2025-04-05 18:38:37 +00:00
24aa60cb48 Merge pull request 'Next release' (#25) from devel into main
All checks were successful
Rust Build / Check (push) Successful in 28s
Rust Build / Test Suite (push) Successful in 35s
Rust Build / Rustfmt (push) Successful in 28s
Rust Build / Clippy (push) Successful in 31s
Rust Build / build (push) Successful in 30s
Release Tagging / release (push) Successful in 34s
Reviewed-on: #25
2025-04-04 04:08:03 +00:00
d8eadb8187 Merge pull request 'v0.2.0 Release' (#20) from devel into main
Some checks failed
Rust Build / Check (push) Successful in 28s
Rust Build / Test Suite (push) Successful in 31s
Rust Build / Rustfmt (push) Successful in 31s
Rust Build / Clippy (push) Successful in 28s
Rust Build / build (push) Successful in 27s
Release Tagging / release (push) Failing after 34s
Reviewed-on: phoenix/icarus-models#20
2025-03-30 17:21:27 +00:00
2b2e96c02d Merge pull request 'devel' (#16) from devel into main
All checks were successful
Rust Build / Check (push) Successful in 26s
Rust Build / Test Suite (push) Successful in 26s
Rust Build / Rustfmt (push) Successful in 26s
Rust Build / Clippy (push) Successful in 26s
Rust Build / build (push) Successful in 26s
Release Tagging / release (push) Successful in 28s
Reviewed-on: phoenix/icarus-models#16
2025-03-22 21:24:15 +00:00
12 changed files with 715 additions and 426 deletions

View File

@@ -1,10 +1,9 @@
name: Release Tagging name: Release Tagging
on: on:
push: pull_request:
branches: branches:
- main - main
- devel
jobs: jobs:
release: release:
@@ -18,7 +17,7 @@ jobs:
- name: Install Rust - name: Install Rust
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: 1.88.0 toolchain: 1.90.0
components: cargo components: cargo
- name: Extract Version from Cargo.toml - name: Extract Version from Cargo.toml
@@ -50,6 +49,3 @@ jobs:
release_name: Release ${{ steps.version.outputs.project_tag_release }} release_name: Release ${{ steps.version.outputs.project_tag_release }}
body: | body: |
Release of version ${{ steps.version.outputs.project_tag_release }} Release of version ${{ steps.version.outputs.project_tag_release }}
# draft: false
# prerelease: ${{ startsWith(github.ref, 'v') == false }} # prerelease if not a valid release tag

View File

@@ -4,11 +4,9 @@ on:
push: push:
branches: branches:
- main - main
- devel
pull_request: pull_request:
branches: branches:
- main - main
- devel
jobs: jobs:
check: check:
@@ -18,7 +16,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1 - uses: actions-rust-lang/setup-rust-toolchain@v1
with: with:
toolchain: 1.88.0 toolchain: 1.90.0
- run: cargo check - run: cargo check
test: test:
@@ -28,7 +26,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1 - uses: actions-rust-lang/setup-rust-toolchain@v1
with: with:
toolchain: 1.88.0 toolchain: 1.90.0
- run: cargo test - run: cargo test
fmt: fmt:
@@ -38,7 +36,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1 - uses: actions-rust-lang/setup-rust-toolchain@v1
with: with:
toolchain: 1.88.0 toolchain: 1.90.0
- run: rustup component add rustfmt - run: rustup component add rustfmt
- run: cargo fmt --all -- --check - run: cargo fmt --all -- --check
@@ -49,7 +47,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1 - uses: actions-rust-lang/setup-rust-toolchain@v1
with: with:
toolchain: 1.88.0 toolchain: 1.90.0
- run: rustup component add clippy - run: rustup component add clippy
- run: cargo clippy -- -D warnings - run: cargo clippy -- -D warnings
@@ -60,7 +58,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1 - uses: actions-rust-lang/setup-rust-toolchain@v1
with: with:
toolchain: 1.88.0 toolchain: 1.90.0
- run: cargo build - run: cargo build

540
Cargo.lock generated
View File

@@ -3,10 +3,37 @@
version = 4 version = 4
[[package]] [[package]]
name = "bitflags" name = "adler2"
version = "2.9.0" version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
[[package]]
name = "aho-corasick"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
dependencies = [
"memchr",
]
[[package]]
name = "anyhow"
version = "1.0.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61"
[[package]]
name = "base64"
version = "0.22.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
[[package]]
name = "bitflags"
version = "2.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394"
[[package]] [[package]]
name = "bumpalo" name = "bumpalo"
@@ -15,26 +42,51 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43"
[[package]] [[package]]
name = "cfg-if" name = "cc"
version = "1.0.0" version = "1.2.41"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" checksum = "ac9fe6cdbb24b6ade63616c0a0688e45bb56732262c158df3c0c4bea4ca47cb7"
[[package]]
name = "deranged"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e"
dependencies = [ dependencies = [
"powerfmt", "find-msvc-tools",
"serde", "shlex",
] ]
[[package]] [[package]]
name = "errno" name = "cfg-if"
version = "0.3.10" version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9"
[[package]]
name = "crc32fast"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511"
dependencies = [
"cfg-if",
]
[[package]]
name = "deranged"
version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a41953f86f8a05768a6cda24def994fd2f424b04ec5c719cf89989779f199071"
dependencies = [
"powerfmt",
"serde_core",
]
[[package]]
name = "equivalent"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
[[package]]
name = "errno"
version = "0.3.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
dependencies = [ dependencies = [
"libc", "libc",
"windows-sys", "windows-sys",
@@ -47,10 +99,41 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
[[package]] [[package]]
name = "getrandom" name = "find-msvc-tools"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127"
[[package]]
name = "flate2"
version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc5a4e564e38c699f2880d3fda590bedc2e69f3f84cd48b457bd892ce61d0aa9"
dependencies = [
"crc32fast",
"miniz_oxide",
]
[[package]]
name = "foreign-types"
version = "0.3.2" version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
dependencies = [
"foreign-types-shared",
]
[[package]]
name = "foreign-types-shared"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
[[package]]
name = "getrandom"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"libc", "libc",
@@ -58,18 +141,38 @@ dependencies = [
"wasi", "wasi",
] ]
[[package]]
name = "hashbrown"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d"
[[package]] [[package]]
name = "icarus_models" name = "icarus_models"
version = "0.4.3" version = "0.7.0"
dependencies = [ dependencies = [
"josekit",
"rand", "rand",
"serde", "serde",
"serde_json", "serde_json",
"tempfile", "tempfile",
"time", "time",
"utoipa",
"uuid", "uuid",
] ]
[[package]]
name = "indexmap"
version = "2.11.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5"
dependencies = [
"equivalent",
"hashbrown",
"serde",
"serde_core",
]
[[package]] [[package]]
name = "itoa" name = "itoa"
version = "1.0.15" version = "1.0.15"
@@ -77,10 +180,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
[[package]] [[package]]
name = "js-sys" name = "josekit"
version = "0.3.77" version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" checksum = "a808e078330e6af222eb0044b71d4b1ff981bfef43e7bc8133a88234e0c86a0c"
dependencies = [
"anyhow",
"base64",
"flate2",
"openssl",
"regex",
"serde",
"serde_json",
"thiserror",
"time",
]
[[package]]
name = "js-sys"
version = "0.3.81"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec48937a97411dcb524a265206ccd4c90bb711fca92b2792c407f268825b9305"
dependencies = [ dependencies = [
"once_cell", "once_cell",
"wasm-bindgen", "wasm-bindgen",
@@ -88,27 +208,37 @@ dependencies = [
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.171" version = "0.2.177"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976"
[[package]] [[package]]
name = "linux-raw-sys" name = "linux-raw-sys"
version = "0.9.3" version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039"
[[package]] [[package]]
name = "log" name = "log"
version = "0.4.27" version = "0.4.28"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432"
[[package]] [[package]]
name = "memchr" name = "memchr"
version = "2.7.4" version = "2.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
[[package]]
name = "miniz_oxide"
version = "0.8.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"
dependencies = [
"adler2",
"simd-adler32",
]
[[package]] [[package]]
name = "num-conv" name = "num-conv"
@@ -122,6 +252,50 @@ version = "1.21.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
[[package]]
name = "openssl"
version = "0.10.73"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8"
dependencies = [
"bitflags",
"cfg-if",
"foreign-types",
"libc",
"once_cell",
"openssl-macros",
"openssl-sys",
]
[[package]]
name = "openssl-macros"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "openssl-sys"
version = "0.9.109"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571"
dependencies = [
"cc",
"libc",
"pkg-config",
"vcpkg",
]
[[package]]
name = "pkg-config"
version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
[[package]] [[package]]
name = "powerfmt" name = "powerfmt"
version = "0.2.0" version = "0.2.0"
@@ -139,33 +313,33 @@ dependencies = [
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.94" version = "1.0.101"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]] [[package]]
name = "quote" name = "quote"
version = "1.0.40" version = "1.0.41"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
] ]
[[package]] [[package]]
name = "r-efi" name = "r-efi"
version = "5.2.0" version = "5.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
[[package]] [[package]]
name = "rand" name = "rand"
version = "0.9.1" version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
dependencies = [ dependencies = [
"rand_chacha", "rand_chacha",
"rand_core", "rand_core",
@@ -191,10 +365,39 @@ dependencies = [
] ]
[[package]] [[package]]
name = "rustix" name = "regex"
version = "1.0.3" version = "1.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e56a18552996ac8d29ecc3b190b4fdbb2d91ca4ec396de7bbffaf43f3d637e96" checksum = "4a52d8d02cacdb176ef4678de6c052efb4b3da14b78e4db683a4252762be5433"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata",
"regex-syntax",
]
[[package]]
name = "regex-automata"
version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "722166aa0d7438abbaa4d5cc2c649dac844e8c56d82fb3d33e9c34b5cd268fc6"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
]
[[package]]
name = "regex-syntax"
version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3160422bbd54dd5ecfdca71e5fd59b7b8fe2b1697ab2baf64f6d05dcc66d298"
[[package]]
name = "rustix"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"errno", "errno",
@@ -205,9 +408,9 @@ dependencies = [
[[package]] [[package]]
name = "rustversion" name = "rustversion"
version = "1.0.21" version = "1.0.22"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
[[package]] [[package]]
name = "ryu" name = "ryu"
@@ -217,18 +420,28 @@ checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.219" version = "1.0.228"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
dependencies = [
"serde_core",
"serde_derive",
]
[[package]]
name = "serde_core"
version = "1.0.228"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
dependencies = [ dependencies = [
"serde_derive", "serde_derive",
] ]
[[package]] [[package]]
name = "serde_derive" name = "serde_derive"
version = "1.0.219" version = "1.0.228"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -237,21 +450,35 @@ dependencies = [
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.140" version = "1.0.145"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c"
dependencies = [ dependencies = [
"indexmap",
"itoa", "itoa",
"memchr", "memchr",
"ryu", "ryu",
"serde", "serde",
"serde_core",
] ]
[[package]] [[package]]
name = "syn" name = "shlex"
version = "2.0.100" version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
[[package]]
name = "simd-adler32"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe"
[[package]]
name = "syn"
version = "2.0.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -260,9 +487,9 @@ dependencies = [
[[package]] [[package]]
name = "tempfile" name = "tempfile"
version = "3.20.0" version = "3.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16"
dependencies = [ dependencies = [
"fastrand", "fastrand",
"getrandom", "getrandom",
@@ -272,10 +499,30 @@ dependencies = [
] ]
[[package]] [[package]]
name = "time" name = "thiserror"
version = "0.3.41" version = "2.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "2.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "time"
version = "0.3.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d"
dependencies = [ dependencies = [
"deranged", "deranged",
"itoa", "itoa",
@@ -288,15 +535,15 @@ dependencies = [
[[package]] [[package]]
name = "time-core" name = "time-core"
version = "0.1.4" version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b"
[[package]] [[package]]
name = "time-macros" name = "time-macros"
version = "0.2.22" version = "0.2.24"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" checksum = "30cfb0125f12d9c277f35663a0a33f8c30190f4e4574868a330595412d34ebf3"
dependencies = [ dependencies = [
"num-conv", "num-conv",
"time-core", "time-core",
@@ -304,15 +551,39 @@ dependencies = [
[[package]] [[package]]
name = "unicode-ident" name = "unicode-ident"
version = "1.0.18" version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d"
[[package]]
name = "utoipa"
version = "5.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fcc29c80c21c31608227e0912b2d7fddba57ad76b606890627ba8ee7964e993"
dependencies = [
"indexmap",
"serde",
"serde_json",
"utoipa-gen",
]
[[package]]
name = "utoipa-gen"
version = "5.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d79d08d92ab8af4c5e8a6da20c47ae3f61a0f1dabc1997cdf2d082b757ca08b"
dependencies = [
"proc-macro2",
"quote",
"syn",
"uuid",
]
[[package]] [[package]]
name = "uuid" name = "uuid"
version = "1.17.0" version = "1.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2"
dependencies = [ dependencies = [
"getrandom", "getrandom",
"js-sys", "js-sys",
@@ -321,31 +592,47 @@ dependencies = [
] ]
[[package]] [[package]]
name = "wasi" name = "vcpkg"
version = "0.14.2+wasi-0.2.4" version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
[[package]]
name = "wasi"
version = "0.14.7+wasi-0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c"
dependencies = [ dependencies = [
"wit-bindgen-rt", "wasip2",
]
[[package]]
name = "wasip2"
version = "1.0.1+wasi-0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7"
dependencies = [
"wit-bindgen",
] ]
[[package]] [[package]]
name = "wasm-bindgen" name = "wasm-bindgen"
version = "0.2.100" version = "0.2.104"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" checksum = "c1da10c01ae9f1ae40cbfac0bac3b1e724b320abfcf52229f80b547c0d250e2d"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"once_cell", "once_cell",
"rustversion", "rustversion",
"wasm-bindgen-macro", "wasm-bindgen-macro",
"wasm-bindgen-shared",
] ]
[[package]] [[package]]
name = "wasm-bindgen-backend" name = "wasm-bindgen-backend"
version = "0.2.100" version = "0.2.104"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" checksum = "671c9a5a66f49d8a47345ab942e2cb93c7d1d0339065d4f8139c486121b43b19"
dependencies = [ dependencies = [
"bumpalo", "bumpalo",
"log", "log",
@@ -357,9 +644,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro" name = "wasm-bindgen-macro"
version = "0.2.100" version = "0.2.104"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" checksum = "7ca60477e4c59f5f2986c50191cd972e3a50d8a95603bc9434501cf156a9a119"
dependencies = [ dependencies = [
"quote", "quote",
"wasm-bindgen-macro-support", "wasm-bindgen-macro-support",
@@ -367,9 +654,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro-support" name = "wasm-bindgen-macro-support"
version = "0.2.100" version = "0.2.104"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" checksum = "9f07d2f20d4da7b26400c9f4a0511e6e0345b040694e8a75bd41d578fa4421d7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -380,109 +667,48 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-shared" name = "wasm-bindgen-shared"
version = "0.2.100" version = "0.2.104"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" checksum = "bad67dc8b2a1a6e5448428adec4c3e84c43e561d8c9ee8a9e5aabeb193ec41d1"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]]
name = "windows-link"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
[[package]] [[package]]
name = "windows-sys" name = "windows-sys"
version = "0.59.0" version = "0.61.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
dependencies = [ dependencies = [
"windows-targets", "windows-link",
] ]
[[package]] [[package]]
name = "windows-targets" name = "wit-bindgen"
version = "0.52.6" version = "0.46.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59"
dependencies = [
"windows_aarch64_gnullvm",
"windows_aarch64_msvc",
"windows_i686_gnu",
"windows_i686_gnullvm",
"windows_i686_msvc",
"windows_x86_64_gnu",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_i686_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
name = "windows_i686_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "wit-bindgen-rt"
version = "0.39.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1"
dependencies = [
"bitflags",
]
[[package]] [[package]]
name = "zerocopy" name = "zerocopy"
version = "0.8.24" version = "0.8.27"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c"
dependencies = [ dependencies = [
"zerocopy-derive", "zerocopy-derive",
] ]
[[package]] [[package]]
name = "zerocopy-derive" name = "zerocopy-derive"
version = "0.8.24" version = "0.8.27"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",

View File

@@ -1,17 +1,19 @@
[package] [package]
name = "icarus_models" name = "icarus_models"
version = "0.4.3" version = "0.7.0"
edition = "2024" edition = "2024"
rust-version = "1.88" rust-version = "1.90"
description = "models used for the icarus project" description = "models used for the icarus project"
license = "MIT" license = "MIT"
[dependencies] [dependencies]
serde = { version = "1.0.219", features = ["derive"] } serde = { version = "1.0.228", features = ["derive"] }
serde_json = { version = "1.0.140" } serde_json = { version = "1.0.145" }
rand = { version = "0.9.1" } rand = { version = "0.9.2" }
time = { version = "0.3.41", features = ["formatting", "macros", "parsing", "serde"] } time = { version = "0.3.44", features = ["formatting", "macros", "parsing", "serde"] }
uuid = { version = "1.17.0", features = ["v4", "serde"] } uuid = { version = "1.18.1", features = ["v4", "serde"] }
josekit = { version = "0.10.3" }
utoipa = { version = "5.4.0", features = ["uuid", "time"] }
[dev-dependencies] [dev-dependencies]
tempfile = { version = "3.20.0" } tempfile = { version = "3.23.0" }

View File

@@ -0,0 +1,2 @@
A library containing commonly used models and functions that is used throughout
icarus projects. This reduces the amount of duplicated code without a benefit.

View File

@@ -2,7 +2,7 @@ use std::default::Default;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize, utoipa::ToSchema)]
pub struct AccessLevel { pub struct AccessLevel {
pub id: uuid::Uuid, pub id: uuid::Uuid,
pub level: String, pub level: String,

View File

@@ -1,13 +1,16 @@
use std::io::Read; use std::io::Write;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Default, Deserialize, Serialize)] #[derive(Clone, Debug, Default, Deserialize, Serialize, utoipa::ToSchema)]
pub struct CoverArt { pub struct CoverArt {
pub id: uuid::Uuid, pub id: uuid::Uuid,
pub title: String, pub title: String,
#[serde(skip)]
pub path: String, pub path: String,
#[serde(skip)]
pub data: Vec<u8>, pub data: Vec<u8>,
pub song_id: uuid::Uuid,
} }
pub mod init { pub mod init {
@@ -19,13 +22,45 @@ pub mod init {
title: String::new(), title: String::new(),
path: path.clone(), path: path.clone(),
data: Vec::new(), data: Vec::new(),
song_id: uuid::Uuid::nil(),
} }
} }
} }
impl CoverArt { impl CoverArt {
pub fn to_data(&self) -> Result<Vec<u8>, std::io::Error> { /// Saves the coverart to the filesystem
let path: &String = &self.path; pub fn save_to_filesystem(&self) -> Result<(), std::io::Error> {
match std::fs::File::create(&self.path) {
Ok(mut file) => match file.write_all(&self.data) {
Ok(_) => Ok(()),
Err(err) => Err(err),
},
Err(err) => Err(err),
}
}
/// Removes the coverart from the filesystem
pub fn remove_from_filesystem(&self) -> Result<(), std::io::Error> {
let p = std::path::Path::new(&self.path);
if p.exists() {
match std::fs::remove_file(p) {
Ok(_) => Ok(()),
Err(err) => Err(err),
}
} else {
Err(std::io::Error::other(
"Cannot delete file that does not exist",
))
}
}
}
pub mod io {
use std::io::Read;
/// Gets the raw data of the cover art
pub fn to_data(coverart: &super::CoverArt) -> Result<Vec<u8>, std::io::Error> {
let path: &String = &coverart.path;
let mut file = std::fs::File::open(path)?; let mut file = std::fs::File::open(path)?;
let mut buffer = Vec::new(); let mut buffer = Vec::new();
match file.read_to_end(&mut buffer) { match file.read_to_end(&mut buffer) {

View File

@@ -2,7 +2,7 @@ use std::default::Default;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize, utoipa::ToSchema)]
pub struct LoginResult { pub struct LoginResult {
pub id: uuid::Uuid, pub id: uuid::Uuid,
pub username: String, pub username: String,

View File

@@ -1,13 +1,16 @@
use std::io::Read; use std::io::Write;
use rand::Rng;
use serde::{Deserialize, Serialize};
use crate::constants; use crate::constants;
use crate::init; use crate::init;
use crate::types; use crate::types;
use rand::Rng; /// Length of characters of a filename to be generated
use serde::{Deserialize, Serialize}; const FILENAME_LENGTH: i32 = 16;
#[derive(Clone, Debug, Default, Deserialize, Serialize)] #[derive(Clone, Debug, Default, Deserialize, Serialize, utoipa::ToSchema)]
pub struct Song { pub struct Song {
#[serde(skip_serializing_if = "init::is_uuid_nil")] #[serde(skip_serializing_if = "init::is_uuid_nil")]
#[serde(alias = "id")] #[serde(alias = "id")]
@@ -46,6 +49,7 @@ pub struct Song {
pub data: Vec<u8>, pub data: Vec<u8>,
#[serde(skip)] #[serde(skip)]
pub directory: String, pub directory: String,
// TODO: Think about what to do with this
// #[serde(skip)] // #[serde(skip)]
// pub album_id: i32, // pub album_id: i32,
// #[serde(skip)] // #[serde(skip)]
@@ -89,10 +93,116 @@ impl Song {
} }
} }
pub fn to_data(&self) -> Result<Vec<u8>, std::io::Error> { /// Saves the song to the filesystem using the song's data
let path_result = self.song_path(); pub fn save_to_filesystem(&self) -> Result<(), std::io::Error> {
match self.song_path() {
Ok(song_path) => match std::fs::File::create(&song_path) {
Ok(mut file) => match file.write_all(&self.data) {
Ok(_res) => Ok(()),
Err(err) => Err(err),
},
Err(err) => Err(err),
},
Err(err) => Err(err),
}
}
match path_result { /// Removes the song from the filesystem
pub fn remove_from_filesystem(&self) -> Result<(), std::io::Error> {
match self.song_path() {
Ok(song_path) => {
let p = std::path::Path::new(&song_path);
if p.exists() {
match std::fs::remove_file(p) {
Ok(_) => Ok(()),
Err(err) => Err(err),
}
} else {
Err(std::io::Error::other(
"Cannot delete file that does not exist",
))
}
}
Err(err) => Err(err),
}
}
}
/// Generates a filename. In order to save a song to the filesystem, the song must have
/// a directory and filename
pub fn generate_filename(typ: types::MusicTypes, randomize: bool) -> String {
let file_extension = match typ {
types::MusicTypes::DefaultMusicExtension => {
String::from(constants::file_extensions::audio::DEFAULTMUSICEXTENSION)
}
types::MusicTypes::WavExtension => {
String::from(constants::file_extensions::audio::WAVEXTENSION)
}
types::MusicTypes::FlacExtension => {
String::from(constants::file_extensions::audio::FLACEXTENSION)
}
types::MusicTypes::MPThreeExtension => {
String::from(constants::file_extensions::audio::MPTHREEEXTENSION)
}
};
if randomize {
let mut filename: String = String::new();
let some_chars: String = String::from("abcdefghij0123456789");
let mut rng = rand::rng();
for _ in 0..FILENAME_LENGTH {
let index = rng.random_range(0..=19);
let rando_char = some_chars.chars().nth(index);
if let Some(c) = rando_char {
filename.push(c);
}
}
filename + &file_extension
} else {
"track-output".to_string() + &file_extension
}
}
/// I/O operations for songs
pub mod io {
use std::io::Read;
/// Copies a song using the source song's data
pub fn copy_song(
song_source: &super::Song,
song_target: &mut super::Song,
) -> Result<(), std::io::Error> {
match song_target.song_path() {
Ok(songpath) => {
let p = std::path::Path::new(&songpath);
if p.exists() {
Err(std::io::Error::other(
"Cannot copy song over to one that already exists",
))
} else {
if song_target.data.is_empty() {
song_target.data = song_source.data.clone();
} else {
song_target.data.clear();
song_target.data = song_source.data.clone();
}
match song_target.save_to_filesystem() {
Ok(_) => Ok(()),
Err(err) => Err(err),
}
}
}
Err(err) => Err(err),
}
}
/// Gets the raw file data of a song from the filesystem
pub fn to_data(song: &super::Song) -> Result<Vec<u8>, std::io::Error> {
match song.song_path() {
Ok(path) => { Ok(path) => {
let mut file = std::fs::File::open(path)?; let mut file = std::fs::File::open(path)?;
let mut buffer: Vec<u8> = Vec::new(); let mut buffer: Vec<u8> = Vec::new();
@@ -107,194 +217,4 @@ impl Song {
Err(er) => Err(er), Err(er) => Err(er),
} }
} }
pub fn generate_filename(&self, typ: types::MusicTypes, randomize: bool) -> String {
let mut filename: String = String::new();
let filename_len = 10;
let file_extension = match typ {
types::MusicTypes::DefaultMusicExtension => {
String::from(constants::file_extensions::audio::DEFAULTMUSICEXTENSION)
}
types::MusicTypes::WavExtension => {
String::from(constants::file_extensions::audio::WAVEXTENSION)
}
types::MusicTypes::FlacExtension => {
String::from(constants::file_extensions::audio::FLACEXTENSION)
}
types::MusicTypes::MPThreeExtension => {
String::from(constants::file_extensions::audio::MPTHREEEXTENSION)
}
};
if randomize {
let some_chars: String = String::from("abcdefghij0123456789");
let mut rng = rand::rng();
for _i in 0..filename_len {
let random_number: i32 = rng.random_range(0..=19);
let index = random_number as usize;
let rando_char = some_chars.chars().nth(index);
if let Some(c) = rando_char {
filename.push(c);
}
}
} else {
filename += "track-output";
}
filename += &file_extension;
filename
}
} }
/*
mod embedded {
use std::io::Read;
use serde::{Deserialize, Serialize};
impl Song {
pub fn to_metadata_json(&self, pretty: bool) -> Result<String, serde_json::Error> {
if pretty {
serde_json::to_string_pretty(&self)
} else {
serde_json::to_string(&self)
}
}
pub fn song_path(&self) -> Result<String, std::io::Error> {
if self.directory.is_empty() {
return Err(std::io::Error::new(
std::io::ErrorKind::Other,
"Directory does not exist",
));
}
let directory = &self.directory;
let mut buffer: String = directory.clone();
let last_index = directory.len() - 1;
if let Some(character) = directory.chars().nth(last_index) {
if character != '/' {
buffer += "/";
}
buffer += &self.filename.clone();
Ok(buffer)
} else {
Err(std::io::Error::new(
std::io::ErrorKind::Other,
"Could not access last character of directory",
))
}
}
pub fn to_data(&self) -> Result<Vec<u8>, std::io::Error> {
let path_result = self.song_path();
match path_result {
Ok(path) => {
let mut file = std::fs::File::open(path)?;
let mut buffer: Vec<u8> = Vec::new();
file.read_to_end(&mut buffer)?;
if buffer.is_empty() {
Err(std::io::Error::new(
std::io::ErrorKind::Other,
"File is empty",
))
} else {
Ok(buffer)
}
}
Err(er) => Err(er),
}
}
}
// The song's duration is a floating point in seconds
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Song {
#[serde(skip_serializing_if = "init::is_uuid_nil")]
#[serde(alias = "id")]
pub id: uuid::Uuid,
#[serde(skip_serializing_if = "String::is_empty")]
pub title: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub artist: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub album: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub album_artist: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub genre: String,
#[serde(skip_serializing_if = "init::is_embed_zero")]
pub year: i32,
#[serde(skip_serializing_if = "init::is_embed_dur_not_set")]
pub duration: f64,
#[serde(skip_serializing_if = "init::is_embed_zero")]
pub track: i32,
#[serde(skip_serializing_if = "init::is_embed_zero")]
pub disc: i32,
#[serde(skip_serializing_if = "init::is_embed_zero")]
pub disc_count: i32,
#[serde(skip_serializing_if = "init::is_embed_zero")]
pub track_count: i32,
#[serde(skip_serializing_if = "String::is_empty")]
pub audio_type: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub date_created: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub filename: String,
#[serde(skip_serializing_if = "init::is_embed_zero")]
pub user_id: i32,
#[serde(skip)]
pub data: Vec<u8>,
#[serde(skip)]
pub directory: String,
// #[serde(skip)]
// pub album_id: i32,
// #[serde(skip)]
// pub artist_id: i32,
// #[serde(skip)]
// pub genre_id: i32,
// #[serde(skip)]
// pub coverart_id: i32,
}
impl Default for Song {
fn default() -> Self {
Song {
id: uuid::Uuid::nil(),
title: String::new(),
artist: String::new(),
album: String::new(),
album_artist: String::new(),
genre: String::new(),
year: 0,
duration: 0.0,
track: 0,
disc: 0,
disc_count: 0,
track_count: 0,
audio_type: String::new(),
date_created: String::new(),
filename: String::new(),
user_id: 0,
data: Vec::new(),
directory: String::new(),
// album_id: 0,
// artist_id: 0,
// genre_id: 0,
// coverart_id: 0,
}
}
}
}
*/

View File

@@ -62,10 +62,87 @@ impl Token {
} }
} }
pub fn get_issued() -> time::Result<time::OffsetDateTime> {
Ok(time::OffsetDateTime::now_utc())
}
mod util {
pub fn time_to_std_time(
provided_time: &time::OffsetDateTime,
) -> Result<std::time::SystemTime, std::time::SystemTimeError> {
let converted = std::time::SystemTime::from(*provided_time);
Ok(converted)
}
}
#[derive(Debug)]
pub struct TokenResource {
pub message: String,
pub issuer: String,
pub audiences: Vec<String>,
pub id: uuid::Uuid,
}
pub const TOKEN_TYPE: &str = "JWT";
pub fn create_token(
key: &String,
token_resource: &TokenResource,
duration: time::Duration,
) -> Result<(String, i64), josekit::JoseError> {
let mut header = josekit::jws::JwsHeader::new();
header.set_token_type(TOKEN_TYPE);
let mut payload = josekit::jwt::JwtPayload::new();
let message = &token_resource.message;
let issuer = &token_resource.issuer;
let audiences: &Vec<String> = &token_resource.audiences;
payload.set_subject(message);
payload.set_issuer(issuer);
payload.set_audience(audiences.clone());
if !token_resource.id.is_nil() {
match payload.set_claim("id", Some(serde_json::json!(token_resource.id))) {
Ok(_) => {}
Err(err) => {
return Err(err);
}
}
}
match get_issued() {
Ok(issued) => {
let expire = issued + duration;
payload.set_issued_at(&util::time_to_std_time(&issued).unwrap());
payload.set_expires_at(&util::time_to_std_time(&expire).unwrap());
let signer = josekit::jws::alg::hmac::HmacJwsAlgorithm::Hs256
.signer_from_bytes(key.as_bytes())
.unwrap();
Ok((
josekit::jwt::encode_with_signer(&payload, &header, &signer).unwrap(),
(expire - time::OffsetDateTime::UNIX_EPOCH).whole_seconds(),
))
}
Err(e) => Err(josekit::JoseError::InvalidClaim(e.into())),
}
}
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
fn test_key() -> String {
String::from("c3092urmc2219ix320i40m293ic29IM09IN0u879Y8B98YB8yb86TN7B55R4yv4RCVU6Bi8YO8U")
}
fn test_resource() -> TokenResource {
TokenResource {
issuer: String::from("icarus_auth_test"),
message: String::from("Authorization"),
audiences: vec![String::from("icarus_test")],
id: uuid::Uuid::nil(),
}
}
#[test] #[test]
fn test_token_scope_check() { fn test_token_scope_check() {
let mut token = Token::default(); let mut token = Token::default();
@@ -80,4 +157,45 @@ mod tests {
check_scope, token.scope check_scope, token.scope
); );
} }
#[test]
fn test_token_creation() {
let key = test_key();
let test_token_resource = test_resource();
let token_expiration_duration = time::Duration::hours(2);
match create_token(&key, &test_token_resource, token_expiration_duration) {
Ok((token, expire_duration)) => {
assert_eq!(false, token.is_empty(), "Error: Token is empty");
assert!(
expire_duration > 0,
"Token expire duration is invalid {expire_duration:?}"
);
}
Err(err) => {
assert!(false, "Error: {err:?}");
}
}
}
#[test]
fn test_token_creation_with_id() {
let key = test_key();
let mut test_token_resource = test_resource();
test_token_resource.id = uuid::Uuid::new_v4();
let token_expiration_duration = time::Duration::hours(2);
match create_token(&key, &test_token_resource, token_expiration_duration) {
Ok((token, expire_duration)) => {
assert_eq!(false, token.is_empty(), "Error: Token is empty");
assert!(
expire_duration > 0,
"Token expire duration is invalid {expire_duration:?}"
);
}
Err(err) => {
assert!(false, "Error: {err:?}");
}
}
}
} }

View File

@@ -4,7 +4,7 @@ use crate::init;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize, utoipa::ToSchema)]
pub struct User { pub struct User {
#[serde(skip_serializing_if = "init::is_uuid_nil")] #[serde(skip_serializing_if = "init::is_uuid_nil")]
pub id: uuid::Uuid, pub id: uuid::Uuid,

View File

@@ -30,16 +30,12 @@ mod utils {
#[cfg(test)] #[cfg(test)]
mod song_tests { mod song_tests {
use std::fs::File;
use std::io::Write;
use tempfile::tempdir; use tempfile::tempdir;
use crate::utils;
use icarus_models::song; use icarus_models::song;
use icarus_models::types; use icarus_models::types;
use crate::utils;
#[test] #[test]
fn test_song_to_data() { fn test_song_to_data() {
println!("Test"); println!("Test");
@@ -65,7 +61,7 @@ mod song_tests {
Ok(buffer) => { Ok(buffer) => {
assert_eq!(buffer.is_empty(), false); assert_eq!(buffer.is_empty(), false);
match song.to_data() { match song::io::to_data(&song) {
Ok(song_data) => { Ok(song_data) => {
println!("Both files match"); println!("Both files match");
assert_eq!(buffer, song_data); assert_eq!(buffer, song_data);
@@ -103,50 +99,47 @@ mod song_tests {
song.directory = utils::get_tests_directory(); song.directory = utils::get_tests_directory();
song.filename = String::from("track01.flac"); song.filename = String::from("track01.flac");
match song.song_path() { let mut song_cpy = song.clone();
Ok(songpath) => match utils::extract_data_from_file(&songpath) { let temp_dir = tempdir().expect("Failed to create temp dir");
Ok(buffer) => { song_cpy.directory = match temp_dir.path().to_str() {
let mut song_cpy = song.clone(); Some(s) => String::from(s),
let temp_dir = tempdir().expect("Failed to create temp dir"); None => String::new(),
song_cpy.directory = match temp_dir.path().to_str() { };
Some(s) => String::from(s),
None => String::new(),
};
assert_eq!(song.directory.is_empty(), false); assert_eq!(song.directory.is_empty(), false);
song_cpy.filename = song_cpy.filename = song::generate_filename(types::MusicTypes::FlacExtension, true);
song.generate_filename(types::MusicTypes::FlacExtension, true); println!("Directory: {:?}", song_cpy.directory);
println!("Directory: {:?}", song_cpy.directory); println!("File to be created: {:?}", song_cpy.filename);
println!("File to be created: {:?}", song_cpy.filename);
let path = match song_cpy.song_path() { match song::io::copy_song(&song, &mut song_cpy) {
Ok(s_path) => s_path, Ok(_) => {}
Err(err) => { Err(err) => {
assert!(false, "Error: {:?}", err); assert!(false, "Error copying song: Error: {err:?}")
String::new() }
} }
}; }
match File::create(path) { #[test]
Ok(mut file_cpy) => match file_cpy.write_all(&buffer) { fn test_save_song_to_filesystem_and_remove() {
Ok(success) => { let mut song = song::Song::default();
println!("Success: {:?}", success); song.directory = utils::get_tests_directory();
} song.filename = String::from("track02.flac");
Err(err) => {
assert!(false, "Error saving file: {:?}", err); let mut copied_song = song::Song {
} directory: utils::get_tests_directory(),
}, filename: String::from("track02-coppied.flac"),
Err(err) => { ..Default::default()
assert!(false, "Error: {:?}", err); };
}
}; match song::io::copy_song(&song, &mut copied_song) {
} Ok(_) => match copied_song.remove_from_filesystem() {
Ok(_) => {}
Err(err) => { Err(err) => {
assert!(false, "Error: {:?}", err); assert!(false, "Error: {err:?}")
} }
}, },
Err(err) => { Err(err) => {
assert!(false, "Error extracting song data: {:?}", err); assert!(false, "Error: {err:?}")
} }
} }
} }
@@ -154,7 +147,6 @@ mod song_tests {
#[cfg(test)] #[cfg(test)]
mod album_tests { mod album_tests {
use crate::utils; use crate::utils;
use icarus_models::album; use icarus_models::album;