appservice: Rename verify_hs_token to hs_token_matches
This commit is contained in:
parent
325531d13f
commit
14bc4eb7e0
3 changed files with 5 additions and 5 deletions
|
@ -65,7 +65,7 @@ async fn push_transactions(
|
|||
request: IncomingRequest<api::event::push_events::v1::IncomingRequest>,
|
||||
appservice: Data<Appservice>,
|
||||
) -> Result<HttpResponse, Error> {
|
||||
if !appservice.verify_hs_token(request.access_token) {
|
||||
if !appservice.hs_token_matches(request.access_token) {
|
||||
return Ok(HttpResponse::Unauthorized().finish());
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@ async fn query_user_id(
|
|||
request: IncomingRequest<api::query::query_user_id::v1::IncomingRequest>,
|
||||
appservice: Data<Appservice>,
|
||||
) -> Result<HttpResponse, Error> {
|
||||
if !appservice.verify_hs_token(request.access_token) {
|
||||
if !appservice.hs_token_matches(request.access_token) {
|
||||
return Ok(HttpResponse::Unauthorized().finish());
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ async fn query_room_alias(
|
|||
request: IncomingRequest<api::query::query_room_alias::v1::IncomingRequest>,
|
||||
appservice: Data<Appservice>,
|
||||
) -> Result<HttpResponse, Error> {
|
||||
if !appservice.verify_hs_token(request.access_token) {
|
||||
if !appservice.hs_token_matches(request.access_token) {
|
||||
return Ok(HttpResponse::Unauthorized().finish());
|
||||
}
|
||||
|
||||
|
|
|
@ -272,7 +272,7 @@ impl Appservice {
|
|||
/// Compare the given `hs_token` against `registration.hs_token`
|
||||
///
|
||||
/// Returns `true` if the tokens match, `false` otherwise.
|
||||
pub fn verify_hs_token(&self, hs_token: impl AsRef<str>) -> bool {
|
||||
pub fn hs_token_matches(&self, hs_token: impl AsRef<str>) -> bool {
|
||||
self.registration.hs_token == hs_token.as_ref()
|
||||
}
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ async fn test_verify_hs_token() -> Result<()> {
|
|||
|
||||
let registration = appservice.registration();
|
||||
|
||||
assert!(appservice.verify_hs_token(®istration.hs_token));
|
||||
assert!(appservice.hs_token_matches(®istration.hs_token));
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue