Skip to content

Commit

Permalink
Fix server hangup (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
chipsenkbeil authored Jun 18, 2023
1 parent 8009cc9 commit da75801
Show file tree
Hide file tree
Showing 77 changed files with 625 additions and 717 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- `Request` and `Response` types from `distant-net` now support an optional
`Header` to send miscellaneous information
- New feature `tracing` provides https://github.com/tokio-rs/tracing support
as a new `--tracing` flag. Must be compiled with
`RUSTFLAGS="--cfg tokio_unstable"` to properly operate.

### Changed

Expand All @@ -21,6 +24,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `DistantApi` now handles batch requests in parallel, returning the results in
order. To achieve the previous sequential processing of batch requests, the
header value `sequence` needs to be set to true
- Rename `GenericServerRef` to `ServerRef` and remove `ServerRef` trait,
refactoring `TcpServerRef`, `UnixSocketServerRef`, and `WindowsPipeServerRef`
to use the struct instead of `Box<dyn ServerRef>`

## [0.20.0-alpha.8]

Expand Down
6 changes: 4 additions & 2 deletions distant-auth/src/methods/none.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ use async_trait::async_trait;
use crate::authenticator::Authenticator;
use crate::methods::AuthenticationMethod;

/// Authenticaton method for a static secret key
/// Authenticaton method that skips authentication and approves anything.
#[derive(Clone, Debug)]
pub struct NoneAuthenticationMethod;

impl NoneAuthenticationMethod {
pub const ID: &str = "none";

#[inline]
pub fn new() -> Self {
Self
Expand All @@ -26,7 +28,7 @@ impl Default for NoneAuthenticationMethod {
#[async_trait]
impl AuthenticationMethod for NoneAuthenticationMethod {
fn id(&self) -> &'static str {
"none"
Self::ID
}

async fn authenticate(&self, _: &mut dyn Authenticator) -> io::Result<()> {
Expand Down
4 changes: 3 additions & 1 deletion distant-auth/src/methods/static_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ pub struct StaticKeyAuthenticationMethod<T> {
}

impl<T> StaticKeyAuthenticationMethod<T> {
pub const ID: &str = "static_key";

#[inline]
pub fn new(key: T) -> Self {
Self { key }
Expand All @@ -26,7 +28,7 @@ where
T: FromStr + PartialEq + Send + Sync,
{
fn id(&self) -> &'static str {
"static_key"
Self::ID
}

async fn authenticate(&self, authenticator: &mut dyn Authenticator) -> io::Result<()> {
Expand Down
Loading

0 comments on commit da75801

Please sign in to comment.