Fixing up API
This commit is contained in:
parent
27bf5e3ac0
commit
e36d4e2c0a
|
@ -20,7 +20,7 @@ pub enum AuthenticationAppError {
|
|||
NotAuthenticatedError,
|
||||
}
|
||||
|
||||
pub const AuthenticationCapability : Capability = Capability("AuthenticationCapability");
|
||||
pub const AUTHENTICATION_CAPABILITY: Capability = Capability("AuthenticationCapability");
|
||||
|
||||
struct AuthenticationSession<Direction> {
|
||||
long_term_identity: Arc<Identity>,
|
||||
|
@ -37,7 +37,7 @@ struct AuthenticationSession<Direction> {
|
|||
}
|
||||
|
||||
impl<Direction> AuthenticationSession<Direction> where Direction:Clone {
|
||||
pub fn new_outbound(mut conn: Connection<OutboundConnection>, long_term_identity: Arc<Identity>) -> AuthenticationSession<OutboundConnection> {
|
||||
pub fn new_outbound(conn: Connection<OutboundConnection>, long_term_identity: Arc<Identity>) -> AuthenticationSession<OutboundConnection> {
|
||||
let ephemeral_identity = Identity::initialize_ephemeral_identity();
|
||||
let mut auth_session = AuthenticationSession {
|
||||
long_term_identity,
|
||||
|
@ -53,7 +53,7 @@ impl<Direction> AuthenticationSession<Direction> where Direction:Clone {
|
|||
auth_session
|
||||
}
|
||||
|
||||
pub fn new_inbound(mut conn: Connection<InboundConnection>, long_term_identity: Arc<Identity>) -> AuthenticationSession<InboundConnection> {
|
||||
pub fn new_inbound(conn: Connection<InboundConnection>, long_term_identity: Arc<Identity>) -> AuthenticationSession<InboundConnection> {
|
||||
let ephemeral_identity = Identity::initialize_ephemeral_identity();
|
||||
let mut auth_session = AuthenticationSession {
|
||||
long_term_identity,
|
||||
|
@ -112,7 +112,7 @@ impl<Direction> AuthenticationSession<Direction> where Direction:Clone {
|
|||
self.conn.shutdown();
|
||||
Err(NotAuthenticatedError)
|
||||
}
|
||||
Err(err) => Err(NotAuthenticatedError),
|
||||
Err(_err) => Err(NotAuthenticatedError),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue