Commit Graph

1371 Commits

Author SHA1 Message Date
Quat3rnion 08952db014 Fix tests 2024-06-02 19:02:36 -04:00
Quat3rnion ab4435a79f Update tests to use DateTime's for timestamps 2024-06-02 18:12:52 -04:00
Quat3rnion 7b7294433b Make config register_configuration use Rights bitflag object 2024-06-02 18:11:39 -04:00
Quat3rnion c44521320d Feature lock different types for UserSettings::status 2024-06-02 18:11:07 -04:00
Quat3rnion d1b3a9ad9e Convert timestamp fields to DateTime's 2024-06-02 18:10:09 -04:00
Quat3rnion f876f25a2c Update poem dependency 2024-06-02 18:00:07 -04:00
Flori 4be7ea62f2 Add the repository field to Cargo.toml (#496)
To allow [Crates.io](https://crates.io/) , [lib.rs](https://lib.rs/) and
the [Rust Digger](https://rust-digger.code-maven.com/) to link to it.
See [the
manifest](https://doc.rust-lang.org/cargo/reference/manifest.html#the-repository-field)
for the explanation.
2024-05-10 21:15:49 +02:00
Gábor Szabó c44dd269dd Add the repository field to Cargo.toml 2024-05-10 22:12:03 +03:00
kozabrada123 03f1e7d983 Refactor / fix login and register (#495)
Change login and register to only use one ChorusUser object, change the
api of related methods which were also somewhat ugly
2024-05-05 14:43:23 +02:00
kozabrada123 aac31726ec Reuse gateway backends, don't duplicate them for voice gateway (#493) 2024-04-30 16:17:47 +02:00
kozabrada123 b2fd3e18cc Move Shared<T> to types/mod.rs, bump some dependencies (#492)
* deps: bump rustls to 0.21.11

This is done to fix CVE-2024-32650, which practically shouldn't affect
us but it's still better not to use vulnerable dependencies.

* deps: bump h2 to 0.3.26

This is done to fix another vulnerability, which should also not affect
us (non-critical, in h2 servers)

* fix: move Shared<T> to types/mod.rs
2024-04-28 14:15:57 +02:00
kozabrada123 319748c0a7 Use WebSocketEvent derive instead of impl WebSocketEvent for .. (#491)
use derive macro instead of manual impl blocks
2024-04-28 08:32:05 +02:00
kozabrada123 c7af410b2b add WebSocketEvent macro derive, bump chorus-macros to 0.3.0 (#490)
* feat: add WebSocketEvent derive, bump to 0.2.1

* change license, version of macros
2024-04-19 17:13:36 +02:00
Flori cb3551dcd4 Release 0.15.0 (#487)
## Release 0.15.0

### TODO:
- [x] Merge #457  
- [x] Merge #489 

## Changes

- Primitive voice support: #457
- Cleaner code
    - Replace `Arc<RwLock<T>>` with `Shared<T>`: #466 
    - More, better documentation
    - More tests
    - Fix some typos
    - Make gateway `close()` code cleaner
- Remove `#[derive(Eq)]` from types which falsely had this trait derived
- Change license from AGPL-3 to MPL-2.0: #477 
- Bump `whoami`, `mio`, `h2` to fix CVEs
- Bump versions of used GitHub Actions
2024-04-16 18:07:41 +02:00
kozabrada123 0cbc88503b Limit test actions to 30 minutes (#489)
fix: limit all tests to 30 minutes
2024-04-16 17:40:38 +02:00
bitfl0wer a95dda5a87 change version to 0.15.0 2024-04-16 17:38:36 +02:00
kozabrada123 74d6785e50 Primitive voice implementation (feature/voice) (#457)
* Add Webrtc Identify & Ready

* Add more webrtc typings

* Attempt an untested voice gateway implementation

* fmt

* Merge with main

* Same allow as for voice as normal gateway

* Test error observer

* Minor updates

* More derives

* Even more derives

* Small types update

* e

* Minor doc fixes

* Modernise voice gateway

* Add default impl for voicegatewayerror

* Make voice event fields pub

* Event updates via the scientific method

* ??

* Fix bad request in voice gateway init

* Voice gateway updates

* Fix error failing to 'deserialize' properly

* Update voice identify

* Clarify FIXME related to #430

* Update to v7

* Create seperate voice_gateway.rs and voice_udp.rs

* Restructure voice to new module

* fix: deserialization error in speaking bitflags

* feat: kinda janky ip discovery impl

* feat: return ip discovery data + minor update

* feat: packet parsing!

* fix: voice works again

* feat: add voice_media_sink_wants

(comitting uncommited changes to merge)

* chore: rename events/webrtc to events/voice_gateway

* Add UdpHandle

* chore: clippy + other misc updates

* fix: attempt to fix failing wasm build

* chore: yes clippy, that is indeed an unneeded return statement

* feat: add VoiceData struct

* feat: add VoiceData reference to UdpHandler

* feat: decryption?

* chore: formatting

* feat: add ssrc definition (op 12)

* feat: add untested sending & asbtract nonce generation

* feat: Public api! (sorta)

* small updates

* feat: add sequence number

* chore: yes

* feat: merge VoiceHandler into official development

* chore: yes clippy, you are special

* fix: duplicated gateway events

* feat: first try at vgw wasm compat

* fix: blunder

* fix: gateway connect using wrong url

* fix: properly using encrypted data, bad practice for buffer creation

* chore: split voice udp

* feat: udp error handling, create udp/backends

* fix: its the same

* chore: clarify UDP on WASM

* api: split voice gateway and udp features, test for voice gateway in WASM

* feat: new encryption modes, minor code quality

* docs: document voice encryption modes

* chore: unused imports

* chore: update getrandom version to match wasm version

* chore: update on packet size FIXME

* drop buf asap

* Okay can't do that actually

* tests: add nonce test

* normal tests work?

* docs: fix doc warning, fix incorrect refrences to 'webrtc'

* chore: json isn't a doc test

* tests: better gateway auth test

* testing tests

* update voice heartbeat, fix the new test issue

* committed too much

* fix: unused import

* fix: use ip discovery address as string, not as Vec<u8>

* chore: less obnoxious logging

* chore: better unimplemented voice modes handling

* chore: remove unused variable

* chore: use matches macro

* add voice examples, make gateway ones clearer

* rename voice example

* chore: remove unused VoiceHandler

* fix: implement gateway Reconnect and InvalidSession

* Typo

Co-authored-by: Flori <39242991+bitfl0wer@users.noreply.github.com>

* Fix a bunch of typos

Co-authored-by: Flori <39242991+bitfl0wer@users.noreply.github.com>

* fix: error handling while loading native certs

* fix: guh

* use be for nonce bytes

* fix: refactor gw and vgw closures

* remove outdated docs

---------

Co-authored-by: Flori <39242991+bitfl0wer@users.noreply.github.com>
2024-04-16 17:18:21 +02:00
kozabrada123 5209348ac1 Fix code scanning alerts on #487 (#488)
fix codescanning alerts on 0.15.0
2024-04-16 15:54:30 +02:00
bitfl0wer 23c50cd262 bump version, add rust-version 2024-04-16 15:13:27 +02:00
kozabrada123 70ecd021b1 Bump whoami to fix stack buffer overflow (#485)
his was done since whoami versions < 1.5.0 are vulnerable to a stack
buffer overflow.
2024-04-16 08:31:14 +02:00
kozabrada123 9304af2594 Ignore unused imports for pub use (#484) 2024-03-15 17:08:46 +01:00
kozabrada123 2d72442522 Minor docs updates, add Get Private Channels (#483)
* feat: add get_private_channels

* minor docs update and reorder
2024-03-15 16:13:51 +01:00
kozabrada123 ea111a4e35 Bump mio to fix RUSTSEC-2024-0019 (#482) 2024-03-14 20:25:24 +01:00
kozabrada123 5a1931951f Fix broken luna.gitlab.io links (#480)
docs: fix broken luna.gitlab.io links
2024-02-25 09:54:06 +01:00
Flori b21d04647d Move contribution guidelines to CONTRIBUTING.md (#478)
Moves the contribution guidelines from README.md to CONTRIBUTING.md, as
per @striezel's suggestion.
2024-02-04 22:30:08 +01:00
bitfl0wer 7cc5bb11f9 Move contribution guidelines to CONTRIBUTING.md 2024-02-01 11:52:29 +01:00
Flori 64feb91680 License change (#477) 2024-01-31 23:59:42 +01:00
kozabrada123 45f07e0510 Update github/codeql-action to v3 (#476) 2024-01-31 23:15:08 +01:00
Dirk Stolle 862ed9195f Replace unmaintained actions-rs/toolchain by dtolnay/rust-toolchain (#473) 2024-01-31 23:02:10 +01:00
kozabrada123 fde7f18d57 Fix example in readme for #456 (#475) 2024-01-31 22:53:13 +01:00
Dirk Stolle 282602d5c3 Update h2 to 0.3.24 to fix vulnerability RUSTSEC-2024-0003 (#474)
The update fixes a resource exhaustion vulnerability in h2 which
may lead to Denial of Service. For more information on that see
<https://rustsec.org/advisories/RUSTSEC-2024-0003>.
2024-01-31 22:47:46 +01:00
Dirk Stolle 750cc21b0a Bump actions/setup-node in GHA workflow to v4 (#472) 2024-01-31 22:43:54 +01:00
Dirk Stolle c5bfac66e5 Fix a few typos (#471) 2024-01-31 22:27:53 +01:00
bitfl0wer b8ba92cf07 Include license header everywhere 2024-01-30 17:19:34 +01:00
bitfl0wer 3f06cc011c Change license to Mozilla Public License v2.0 2024-01-30 10:03:14 +01:00
bitfl0wer 148ce74715 Change license to Mozilla Public License v2.0 2024-01-30 10:00:05 +01:00
Flori 9aa921ae32 Coverage (#468)
Up the reported coverage on coveralls by adding some missing tests,
especially for types. Also removes/replaces some old, faulty or
non-idiomatic code.

While unit testing might seem a bit bloaty (especially with this many
additions), I'd argue that writing somewhat sensible tests is the only
good way to somewhat reliably keep things from breaking in larger
projects/bigger codebases, such as these.

Most of these tests should, hopefully, be of acceptable quality,
although I do admit that when writing tests, I sometimes just like to
turn my brain off
2024-01-24 23:44:31 +01:00
bitfl0wer 60f55d9d3a exclude trivial id() functions from coverage 2024-01-24 23:26:59 +01:00
bitfl0wer 153bfc26c9 Add comment about test_self_updating_structs 2024-01-24 23:02:16 +01:00
bitfl0wer 9168e5b904 extend self updating structs test 2024-01-24 23:01:38 +01:00
bitfl0wer 9eb6260728 remove hit limit test 2024-01-24 18:51:10 +01:00
bitfl0wer b6f5d93e66 Add test for get_limit_config 2024-01-24 12:32:08 +01:00
bitfl0wer 764f86731d Add test to hit ratelimit 2024-01-24 12:21:46 +01:00
bitfl0wer f3771b31ca Remove PartialOrd from Emoji because unneccessary 2024-01-23 23:53:08 +01:00
bitfl0wer a564293fef Add Message PartialEq Test 2024-01-23 23:42:00 +01:00
bitfl0wer 96ef83270b Add partial_eq test for relationship.rs/Relationship 2024-01-23 23:31:35 +01:00
bitfl0wer 24cec523e0 Remove old/redundant code from attachment.rs 2024-01-23 23:11:37 +01:00
bitfl0wer fcd405939f Add to_public_user test 2024-01-23 23:06:24 +01:00
bitfl0wer c13ba6b291 Rename to_public_user into into_public_user 2024-01-23 23:06:14 +01:00
bitfl0wer 713f9d7846 Add unit tests for guild.rs entities 2024-01-23 21:13:15 +01:00