packages feed

atlassian-connect-core 0.8.2.0 → 0.9.0.0

raw patch · 4 files changed

+28/−5 lines, 4 files

Files

atlassian-connect-core.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           atlassian-connect-core-version:        0.8.2.0+version:        0.9.0.0 synopsis:       Atlassian Connect snaplet for the Snap Framework and helper code. description:    This library allows you to quickly get an Atlassian Connect application running                 on top of the Snap Framework. It provides best practices and helper functions to get you moving
src/Snap/AtlassianConnect.hs view
@@ -48,6 +48,8 @@     , LifecycleResponse(..)     , ClientKey     , Tenant(..)+    , SafeTenant(..)+    , toSafeTenant     , TenantKey     , TenantWithUser     -- * QSH
src/Snap/AtlassianConnect/PageToken.hs view
@@ -64,7 +64,7 @@ -- | Given a tentant, a potential user and a time generate a page token. generateToken :: CT.TenantWithUser -> UTCTime -> PageToken generateToken (tenant, userKey) timestamp = PageToken-  { pageTokenHost = CT.key tenant+  { pageTokenHost = CT.sKey tenant   , pageTokenUser = userKey   , pageTokenTimestamp = timestamp   , pageTokenAllowInsecurePolling = False
src/Snap/AtlassianConnect/Tenant.hs view
@@ -2,6 +2,8 @@ module Snap.AtlassianConnect.Tenant    ( TenantWithUser    , Tenant(..)+   , SafeTenant(..)+   , toSafeTenant    , TenantKey    ) where @@ -13,9 +15,7 @@  -- | When we get a tenant from Atlassian Connect we can also optionally reciever the user key that made the request. -- This structure reflects that possibility.-type TenantWithUser = (Tenant, Maybe CA.UserKey)--instance FromJSON Tenant+type TenantWithUser = (SafeTenant, Maybe CA.UserKey)  -- | Represents a tenant key. The unique identifier for each Atlassian Connect tenant. type TenantKey = T.Text@@ -31,3 +31,24 @@    , baseUrl       :: ConnectURI    -- ^ The base url of the Atlassian Cloud host application (product).    , productType   :: T.Text        -- ^ The type of product you have connected to in the Atlassian Cloud. (E.g. JIRA, Confluence)    } deriving (Eq, Show, Generic)++-- | Represents an Atlassian Cloud tenant. Your Atlassian Connect add-on can be installed into multiple Atlassian+-- Cloud tenants.+data SafeTenant = SafeTenant+   { sTenantId      :: Integer       -- ^ Your identifier for this tenant.+   , sKey           :: TenantKey     -- ^ The unique identifier for this tenant accross Atlassian Connect.+   , sPublicKey     :: T.Text        -- ^ The public key for this atlassian connect application.+   , sOauthClientId :: Maybe T.Text  -- ^ The OAuth Client Id for this tenant. If this add-on does not support user impersonation then this may not be present.+   , sBaseUrl       :: ConnectURI    -- ^ The base url of the Atlassian Cloud host application (product).+   , sProductType   :: T.Text        -- ^ The type of product you have connected to in the Atlassian Cloud. (E.g. JIRA, Confluence)+   } deriving (Eq, Show, Generic)++toSafeTenant :: Tenant -> SafeTenant+toSafeTenant t = SafeTenant+   { sTenantId = tenantId t+   , sKey = key t+   , sPublicKey = publicKey t+   , sOauthClientId = oauthClientId t+   , sBaseUrl = baseUrl t+   , sProductType = productType t+   }