gopro-plus-0.6.5.1: GoPro Plus Client API.
Copyright(c) Dustin Sallings 2020
LicenseBSD3
Maintainerdustin@spy.net
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

GoPro.Plus.Auth

Description

GoPro Plus authentication.

Synopsis

Documentation

authenticate Source #

Arguments

:: MonadIO m 
=> String

Email/username

-> String

Password

-> m AuthInfo 

Authenticate against the GoPro Plus service.

refreshAuth :: MonadIO m => AuthInfo -> m AuthInfo Source #

Refresh authentication credentials using a refresh token.

data AuthInfo Source #

An Authentication response.

Instances

Instances details
Show AuthInfo Source # 
Instance details

Defined in GoPro.Plus.Auth

Generic AuthInfo Source # 
Instance details

Defined in GoPro.Plus.Auth

Associated Types

type Rep AuthInfo :: Type -> Type #

Methods

from :: AuthInfo -> Rep AuthInfo x #

to :: Rep AuthInfo x -> AuthInfo #

FromJSON AuthInfo Source # 
Instance details

Defined in GoPro.Plus.Auth

Monad m => HasGoProAuth (AuthReader m) Source # 
Instance details

Defined in GoPro.Plus.Auth

type Rep AuthInfo Source # 
Instance details

Defined in GoPro.Plus.Auth

type Rep AuthInfo = D1 ('MetaData "AuthInfo" "GoPro.Plus.Auth" "gopro-plus-0.6.5.1-HVJKZeAiyIm3QmNtFVFBIT" '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.

Methods

goproAuth :: m AuthInfo Source #

Get the GoPro AuthInfo to use.

Instances

Instances details
Monad m => HasGoProAuth (AuthReader m) Source # 
Instance details

Defined in GoPro.Plus.Auth

HasGoProAuth m => HasGoProAuth (Uploader m) Source # 
Instance details

Defined in GoPro.Plus.Upload

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