Copyright | (c) Dustin Sallings 2020 |
---|---|
License | BSD3 |
Maintainer | dustin@spy.net |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
GoPro Plus authentication.
Synopsis
- authenticate :: MonadIO m => String -> String -> m AuthInfo
- refreshAuth :: MonadIO m => AuthInfo -> m AuthInfo
- data AuthInfo = AuthInfo {}
- access_token :: Lens' AuthInfo Token
- expires_in :: Lens' AuthInfo Int
- refresh_token :: Lens' AuthInfo Text
- resource_owner_id :: Lens' AuthInfo Text
- class Monad m => HasGoProAuth m where
- withAuth :: AuthInfo -> AuthReader m a -> m a
- type AuthReader = ReaderT AuthInfo
- type Token = Text
Documentation
Authenticate against the GoPro Plus service.
refreshAuth :: MonadIO m => AuthInfo -> m AuthInfo Source #
Refresh authentication credentials using a refresh token.
An Authentication response.
AuthInfo | |
|
Instances
Show AuthInfo Source # | |
Generic AuthInfo Source # | |
FromJSON AuthInfo Source # | |
Monad m => HasGoProAuth (AuthReader m) Source # | |
Defined in GoPro.Plus.Auth goproAuth :: AuthReader m AuthInfo Source # | |
type Rep AuthInfo Source # | |
Defined in GoPro.Plus.Auth type Rep AuthInfo = D1 ('MetaData "AuthInfo" "GoPro.Plus.Auth" "gopro-plus-0.4.1.3-GJbzuYOYT8yJwBPrheePrz" 'False) (C1 ('MetaCons "AuthInfo" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_access_token") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Token) :*: S1 ('MetaSel ('Just "_expires_in") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "_refresh_token") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "_resource_owner_id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))) |
class Monad m => HasGoProAuth m where Source #
A Monad may have a HasGoProAuth
instance to indicate it knows
how to authenticate against the GoPro Plus service.
Instances
Monad m => HasGoProAuth (AuthReader m) Source # | |
Defined in GoPro.Plus.Auth goproAuth :: AuthReader m AuthInfo Source # | |
HasGoProAuth m => HasGoProAuth (Uploader m) Source # | |
withAuth :: AuthInfo -> AuthReader m a -> m a Source #
Convenient function for passing around auth info. You probably don't want to uset his, but it can be convenient when experimenting.
type AuthReader = ReaderT AuthInfo Source #
AuthReader is a convenience type that's useful for doing small experiments where you don't already have your own Reader or similar. e.g., in ghci you might type:
(m :: Medium) <- withAuth (AuthInfo accessToken 0 "" "") $ medium mediumID