add: allow supporters to upload gif avatars/banners
This commit is contained in:
parent
cf38022597
commit
e727de9c63
10 changed files with 231 additions and 52 deletions
|
@ -10,8 +10,35 @@ pub enum PkceChallengeMethod {
|
|||
|
||||
#[derive(Serialize, Deserialize, PartialEq, Eq)]
|
||||
pub enum AppScope {
|
||||
#[serde(alias = "user-read-profile")]
|
||||
UserReadProfile,
|
||||
UserReadSessions,
|
||||
UserReadPosts,
|
||||
UserReadMessages,
|
||||
UserCreatePosts,
|
||||
UserCreateMessages,
|
||||
UserDeletePosts,
|
||||
UserDeleteMessages,
|
||||
}
|
||||
|
||||
impl AppScope {
|
||||
/// Parse the given input string as a list of scopes.
|
||||
pub fn parse(input: &str) -> Vec<AppScope> {
|
||||
let mut out: Vec<AppScope> = Vec::new();
|
||||
for scope in input.split(" ") {
|
||||
out.push(match scope {
|
||||
"user-read-profile" => Self::UserReadProfile,
|
||||
"user-read-sessions" => Self::UserReadSessions,
|
||||
"user-read-posts" => Self::UserReadPosts,
|
||||
"user-read-messages" => Self::UserReadMessages,
|
||||
"user-create-posts" => Self::UserCreatePosts,
|
||||
"user-create-messages" => Self::UserCreateMessages,
|
||||
"user-delete-posts" => Self::UserDeletePosts,
|
||||
"user-delete-messages" => Self::UserDeleteMessages,
|
||||
_ => continue,
|
||||
})
|
||||
}
|
||||
out
|
||||
}
|
||||
}
|
||||
|
||||
/// Check a verifier against the stored challenge (using the given [`PkceChallengeMethod`]).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue