Aelve Codesearch

grep over package repositories
Please provide a string to search for.
3+ characters are required.
Index updated about a month ago

total matches: 40

servant-snap-0.8.4.1
1 matches
test/Servant/ServerSpec.hs
      getSecret :: () -> AppHandler Int
      getSecret () = return 1337

      authHeader un pw = "Basic " <> B64.encode (T.encodeUtf8 un <> ":" <> pw)

  describe "Checks auth" $ do

    it "returns 401 when not logged  in" $ do
      response <- runReqOnApi baApi (baCheck :. EmptyContext) getSecret SC.GET "/secret" "" [] ""

            
strelka-2.0.5
1 matches
library/Strelka/HTTPAuthorizationParsing.hs
  where
    dropPrefix =
      maybe (Left "Not a basic authorization") Right .
      C.stripPrefix "Basic "
    decodeBase64 =
      first adaptFailure .
      A.decode
      where
        adaptFailure string =

            
swagger-petstore-0.0.2.0
1 matches
lib/OpenAPIPetstore/Model.hs
      then req `setHeader` toHeader ("Authorization", T.decodeUtf8 cred)
           & L.over rAuthTypesL (P.filter (/= P.typeOf a))
      else req
    where cred = BC.append "Basic " (B64.encode $ BC.concat [ user, ":", pw ])

-- ** AuthOAuthPetstoreAuth
data AuthOAuthPetstoreAuth =
  AuthOAuthPetstoreAuth Text -- ^ secret
  deriving (P.Eq, P.Show, P.Typeable)

            
symantic-http-client-0.0.1.20190410
1 matches
Symantic/HTTP/Client.hs
			let user_pass = Text.encodeUtf8 $ user<>":"<>pass in
			clientReq_headers req Seq.|>
			 ( HTTP.hAuthorization
			 , Web.toHeader $ "Basic " <> BS64.encode user_pass
			 )
		 }
instance HTTP_Query Client where
	type QueryConstraint Client a = Web.ToHttpApiData a
	queryParams' n = Client $ \k vs -> k $ \req ->

            
symantic-http-test-0.0.1.20190410
3 matches
Hspec/Server/Error.hs
			 `Wai.shouldRespondWith` 200
		it "checks username" $ do
			Wai.request goodMethod goodURI
			 [ (HTTP.hAuthorization, "Basic "<>BS64.encode "no-such-user:pass")
			 , goodAccept
			 , goodContentType
			 ] goodBody
			 `Wai.shouldRespondWith` 401
		it "checks password" $ do

            
Hspec/Server/Error.hs
			 `Wai.shouldRespondWith` 401
		it "checks password" $ do
			Wai.request goodMethod goodURI
			 [ (HTTP.hAuthorization, "Basic "<>BS64.encode "user:wrong-pass")
			 , goodAccept
			 , goodContentType
			 ] goodBody
			 `Wai.shouldRespondWith` 401
		it "can deny access" $ do

            
Hspec/Server/Error.hs
goodURI         = goodPath<>"?param=2"
badParam        = goodPath<>"?param=foo"
goodBody        = "42" -- {-encode-} (42::Int)
goodAuth        = (HTTP.hAuthorization, "Basic "<>BS64.encode "user:pass")
goodHeaders     = [goodAuth, goodAccept, goodContentType]

            
wreq-0.5.3.2
1 matches
httpbin/HttpBin/Server.hs
basicAuth = simpleAuth $ \req ->
  case (rqParam "user" req, rqParam "pass" req) of
    (Just [user], Just [passwd]) | not (':' `B.elem` user) ->
      Just ("Basic " <> B64.encode (user <> ":" <> passwd),
            [("user", toJSON (B.unpack user))])
    _ -> Nothing

oauth2token = simpleAuth $ \req ->
  case (rqParam "kind" req, rqParam "token" req) of

            
wreq-sb-0.4.0.0
1 matches
httpbin/HttpBin/Server.hs
basicAuth = simpleAuth $ \req ->
  case (rqParam "user" req, rqParam "pass" req) of
    (Just [user], Just [passwd]) | not (':' `B.elem` user) ->
      Just ("Basic " <> B64.encode (user <> ":" <> passwd),
            [("user", toJSON (B.unpack user))])
    _ -> Nothing

oauth2token = simpleAuth $ \req ->
  case (rqParam "kind" req, rqParam "token" req) of