1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
extern crate inth_oauth2 as oauth;
extern crate url;
#[macro_use]
extern crate lazy_static;
use oauth::{
token::{Static, Bearer},
provider::Provider,
};
use url::Url;
lazy_static! {
static ref SLACK_AUTH_URI: Url = Url::parse("https://slack.com/oauth/authorize").unwrap();
static ref SLACK_TOKEN_URI: Url = Url::parse("https://slack.com/api/oauth.access").unwrap();
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Slack;
impl Provider for Slack {
type Lifetime = Static;
type Token = Bearer<Self::Lifetime>;
fn auth_uri(&self) -> &Url { &SLACK_AUTH_URI }
fn token_uri(&self) -> &Url { &SLACK_TOKEN_URI }
}