Skip to content

Commit

Permalink
move inactive S3 Query code to new module Aws.S3.Query
Browse files Browse the repository at this point in the history
  • Loading branch information
aristidb committed Feb 12, 2011
1 parent 0e71901 commit e12a282
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 33 deletions.
2 changes: 2 additions & 0 deletions Aws/S3.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ module Aws.S3
(
module Aws.S3.GetService
, module Aws.S3.Model
, module Aws.S3.Query
)
where

import Aws.S3.GetService
import Aws.S3.Model
import Aws.S3.Query
22 changes: 0 additions & 22 deletions Aws/S3/GetService.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,3 @@ where
import Data.ByteString.Lazy.Char8 ({- IsString -})

data GetService = GetService

{-
instance AsQuery GetService where
type Info GetService = () -- < preliminary
asQuery _ _ = Query {
api = S3
, method = Get
, protocol = HTTP
, host = "s3.amazonaws.com"
, port = 80
, path = "/"
, canonicalizedResource = "/"
, subresource = Nothing
, query = []
, date = Nothing
, authorization = Nothing
, contentType = Nothing
, contentMd5 = Nothing
, body = ""
, stringToSign = Nothing
}
-}
35 changes: 35 additions & 0 deletions Aws/S3/Query.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module Aws.S3.Query
where

{-
S3 -> B.intercalate "\n" $ concat [[httpMethod method]
, [fromMaybe "" contentMd5]
, [fromMaybe "" contentType]
, [case ti of
AbsoluteTimestamp time -> fmtRfc822Time time
AbsoluteExpires time -> fmtTimeEpochSeconds time]
, [] -- canonicalized AMZ headers
, [canonicalizedResource]]
-}

{-
instance AsQuery GetService where
type Info GetService = () -- < preliminary
asQuery _ _ = Query {
api = S3
, method = Get
, protocol = HTTP
, host = "s3.amazonaws.com"
, port = 80
, path = "/"
, canonicalizedResource = "/"
, subresource = Nothing
, query = []
, date = Nothing
, authorization = Nothing
, contentType = Nothing
, contentMd5 = Nothing
, body = ""
, stringToSign = Nothing
}
-}
11 changes: 0 additions & 11 deletions Aws/Signature.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,6 @@ amzHash :: AuthorizationHash -> B.ByteString
amzHash HmacSHA1 = "HmacSHA1"
amzHash HmacSHA256 = "HmacSHA256"

{-
S3 -> B.intercalate "\n" $ concat [[httpMethod method]
, [fromMaybe "" contentMd5]
, [fromMaybe "" contentType]
, [case ti of
AbsoluteTimestamp time -> fmtRfc822Time time
AbsoluteExpires time -> fmtTimeEpochSeconds time]
, [] -- canonicalized AMZ headers
, [canonicalizedResource]]
-}

signature :: Credentials -> AuthorizationHash -> B.ByteString -> B.ByteString
signature cr ah input = Base64.encode sig
where
Expand Down
1 change: 1 addition & 0 deletions aws.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Library
Aws.Response,
Aws.S3.GetService,
Aws.S3.Model,
Aws.S3.Query,
Aws.Signature,
Aws.SimpleDb,
Aws.SimpleDb.BatchPutAttributes,
Expand Down

0 comments on commit e12a282

Please sign in to comment.