atlassian-connect-core 0.3.0.0 → 0.4.0.0
raw patch · 3 files changed
+12/−6 lines, 3 filesdep ~configuratorPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: configurator
API changes (from Hackage documentation)
Files
- atlassian-connect-core.cabal +2/−2
- resources/connect.cfg +4/−0
- src/Snap/AtlassianConnect/Connect.hs +6/−4
atlassian-connect-core.cabal view
@@ -10,7 +10,7 @@ -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 0.3.0.0+version: 0.4.0.0 -- A short (one-line) description of the package. synopsis: Atlassian Connect snaplet for the Snap Framework and helper code.@@ -99,7 +99,7 @@ , base64-bytestring == 1.0.* , case-insensitive == 1.* , cipher-aes == 0.2.*- , configurator == 0.2.*+ , configurator == 0.3.* , containers == 0.5.* , hostname == 1.* , http-media == 0.4.*
resources/connect.cfg view
@@ -1,6 +1,10 @@ # Plugin Details base_url = "http://localhost:8080" +# Valid Atlassian Hosts+# This is a list of hostname suffixes that you allow your Atlassian Connect add-on to be installed on.+valid_hosts = ["localhost", "jira-dev.com", "jira.com", "atlassian.net", "atlassian.com"]+ # Secret Key - Currently only used for page tokens. Please keep secure. # A good way to generate a secret key is to run the following in your terminal: # $ dd if=/dev/urandom bs=1000 count=1 2> /dev/null | md5
src/Snap/AtlassianConnect/Connect.hs view
@@ -71,7 +71,8 @@ loadConnectConfig connectConf = do rawBaseUrl <- require connectConf "base_url" "Missing base url in connect configuration file." secret <- require connectConf "secret_key" "Missing secret key in connect configuration file."- hostWhiteList <- validHosts+ hostWhiteListFromConfig <- require connectConf "valid_hosts" "Missing a valid_hosts whitelist."+ hostWhiteList <- addLocalHost hostWhiteListFromConfig let keyLength = BSC.length secret CM.when (keyLength /= 32) $ fail ("Expected Atlassian Connect secret_key to be 32 Hex Digits long but was actually: " ++ show keyLength) envBaseUrl <- DE.getEnv "CONNECT_BASE_URL"@@ -88,6 +89,7 @@ , ccHostWhiteList = hostWhiteList } -validHosts :: IO[Text]-validHosts = fmap hosts HN.getHostName- where hosts localhost = fmap pack (localhost : ["localhost", "jira-dev.com", "jira.com", "atlassian.net"])+addLocalHost :: [Text] -> IO [Text]+addLocalHost originalHosts = do+ localhost <- HN.getHostName+ return $ (pack localhost) : originalHosts