1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-20 12:02:22 +03:00

Use unstable prefixes for scope names (#337)

This commit is contained in:
Hugh Nimmo-Smith
2022-08-05 18:58:22 +01:00
committed by GitHub
parent 2568720106
commit 3215e86eaa
7 changed files with 19 additions and 17 deletions

View File

@@ -219,7 +219,7 @@ pub(crate) async fn complete(
let lacks_consent = grant
.scope
.difference(&current_consent)
.any(|scope| !scope.starts_with("urn:matrix:device:"));
.any(|scope| !scope.starts_with("urn:matrix:org.matrix.msc2967.client:device:"));
// Check if the client lacks consent *or* if consent was explicitely asked
if lacks_consent || grant.requires_consent {

View File

@@ -153,11 +153,11 @@ pub(crate) async fn post(
return Err(anyhow::anyhow!("policy violation").into());
}
// Do not consent for the "urn:matrix:device:*" scope
// Do not consent for the "urn:matrix:org.matrix.msc2967.client:device:*" scope
let scope_without_device = grant
.scope
.iter()
.filter(|s| !s.starts_with("urn:matrix:device:"))
.filter(|s| !s.starts_with("urn:matrix:org.matrix.msc2967.client:device:"))
.cloned()
.collect();
insert_client_consent(