summary refs log tree commit diff
path: root/src/secrets.rs
blob: fa74aa543f44fd1b1770a5e58d3d5f2c148e0fe9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
pub const ACCESS_TOKEN: &str = "access_token";
pub const REFRESH_TOKEN: &str = "refresh_token";

pub const ME: &str = "me";
pub const TOKEN_KIND: &str = "token_kind";
pub const EXPIRES_IN: &str = "expires_in";
pub const MICROPUB: &str = "micropub";
pub const SCOPE: &str = "scope";

pub fn get_schema() -> libsecret::Schema {
    let mut attrs = std::collections::HashMap::new();
    attrs.insert(ME, libsecret::SchemaAttributeType::String);
    attrs.insert(TOKEN_KIND, libsecret::SchemaAttributeType::String);
    attrs.insert(MICROPUB, libsecret::SchemaAttributeType::String);
    attrs.insert(EXPIRES_IN, libsecret::SchemaAttributeType::Integer);
    attrs.insert(SCOPE, libsecret::SchemaAttributeType::String);

    libsecret::Schema::new("org.indieweb.indieauth.BearerCredential", libsecret::SchemaFlags::NONE, attrs)
}