diff options
author | Vika <vika@fireburn.ru> | 2022-09-28 03:55:48 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2022-09-28 03:55:48 +0300 |
commit | 6e20a3c51756c2e84290da6ec53b89a5fc58c0fc (patch) | |
tree | a360c40dce27b7804001038babd4631476232001 /kittybox-rs/indieauth | |
parent | 2f02bf76a40c971b9404aa0913bc8baa7dfde24c (diff) | |
download | kittybox-6e20a3c51756c2e84290da6ec53b89a5fc58c0fc.tar.zst |
Use tokens from the auth backend to authenticate for Micropub
Diffstat (limited to 'kittybox-rs/indieauth')
-rw-r--r-- | kittybox-rs/indieauth/src/lib.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kittybox-rs/indieauth/src/lib.rs b/kittybox-rs/indieauth/src/lib.rs index 22dcdbd..a60cc42 100644 --- a/kittybox-rs/indieauth/src/lib.rs +++ b/kittybox-rs/indieauth/src/lib.rs @@ -538,6 +538,11 @@ impl TokenData { std::time::UNIX_EPOCH + std::time::Duration::from_secs(time) }) } + + /// Check if a certain scope is allowed for this token. + pub fn check_scope(&self, scope: &Scope) -> bool { + self.scope.has(scope) + } } // I don't like this type, because it could've been represented |