Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,41 @@
## Internal changes


# [2021-08-16]

## Release Notes

This is a routine release requiring only the routine upgrade steps.

## API Changes

* Add `POST /conversations/list-ids` (#1686)
* Deprecate `GET /converstations/ids` (#1686)

## Features

* Client functions for the hscim library (#1694, #1699, #1702, https://hackage.haskell.org/package/hscim)

## Bug fixes and other updates

* Change http response code for `missing-legalhold-consent`. (#1688)
* Remove old end-point for changing email

## Federation changes (alpha feature, do not use yet)

* Add new API to list paginated qualified conversation ids (#1686)

## Documentation

* Fix swagger: mark name in UserUpdate as optional (#1691, #1692)

## Internal changes

* Replaced uses of `UVerb` and `EmptyResult` with `MultiVerb` (#1693)
* Added a mechanism to derive `AsUnion` instances automatically (#1693)
* Integration test coverage (#1696, #1704)


# [2021-08-02]

## Release Notes
Expand Down Expand Up @@ -65,6 +100,7 @@ Upgrade nginz (#1658)
* New, hardened end-point for changing email (68b4db08)
* Fix: CSV export is missing SCIM external id when SAML is also used (#1608)
* Fix: sso_id field in user record (brig) was not always filled correctly in cassandra (#1334)
* Change http response code for `missing-legalhold-consent` from 412 to 403 (#1688)

## Documentation

Expand Down
5 changes: 5 additions & 0 deletions libs/cassandra-util/src/Cassandra.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import Cassandra.CQL as C
Consistency (All, One, Quorum),
Cql,
Keyspace (Keyspace),
PagingState (..),
QueryParams (QueryParams),
QueryString (QueryString),
R,
Expand Down Expand Up @@ -58,6 +59,7 @@ import Cassandra.Exec as C
ClientState,
MonadClient,
Page (..),
PageWithState (..),
PrepQuery,
Row,
addPrepQuery,
Expand All @@ -70,8 +72,11 @@ import Cassandra.Exec as C
nextPage,
paginate,
paginateC,
paginateWithState,
params,
paramsP,
paramsPagingState,
pwsHasMore,
query,
query1,
result,
Expand Down
1 change: 1 addition & 0 deletions libs/cassandra-util/src/Cassandra/CQL.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import Database.CQL.Protocol as C
Consistency (All, One, Quorum),
Cql,
Keyspace (Keyspace),
PagingState (..),
QueryParams (QueryParams),
QueryString (QueryString),
R,
Expand Down
35 changes: 33 additions & 2 deletions libs/cassandra-util/src/Cassandra/Exec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ module Cassandra.Exec
x1,
syncCassandra,
paginateC,
PageWithState (..),
paginateWithState,
paramsPagingState,
pwsHasMore,
module C,
)
where
Expand All @@ -34,10 +38,11 @@ import Cassandra.CQL (Consistency, R)
import Control.Monad.Catch
import Data.Conduit
-- We only use these locally.
import Database.CQL.IO (RetrySettings, RunQ, defRetrySettings, eagerRetrySettings)
import Database.CQL.IO (ProtocolError (UnexpectedResponse), RetrySettings, RunQ, defRetrySettings, eagerRetrySettings, getResult, hrHost, hrResponse, runQ)
-- Things we just import and re-export.
import Database.CQL.IO as C (BatchM, Client, ClientState, MonadClient, Page (..), PrepQuery, Row, addPrepQuery, addQuery, adjustConsistency, adjustResponseTimeout, adjustSendTimeout, batch, emptyPage, init, liftClient, localState, paginate, prepared, query, query1, queryString, retry, runClient, schema, setConsistency, setSerialConsistency, setType, shutdown, trans, write)
import Database.CQL.Protocol (Error, QueryParams (QueryParams), Tuple)
import Database.CQL.Protocol (Error, QueryParams (QueryParams), Tuple, pagingState)
import qualified Database.CQL.Protocol as Protocol
import Imports hiding (init)

params :: Tuple a => Consistency -> a -> QueryParams a
Expand Down Expand Up @@ -100,3 +105,29 @@ paginateC q p r = go =<< lift (retry r (paginate q p))
yield (result page)
when (hasMore page) $
go =<< lift (retry r (liftClient (nextPage page)))

data PageWithState a = PageWithState
{ pwsResults :: [a],
pwsState :: Maybe Protocol.PagingState
}
deriving (Functor)

-- | Like 'paginate' but exposes the paging state. This paging state can be
-- serialised and sent to consumers of the API. The state is not good for long
-- term storage as the bytestring format may change when the schema of a table
-- changes or when cassandra is upgraded.
paginateWithState :: (MonadClient m, Tuple a, Tuple b, RunQ q) => q R a b -> QueryParams a -> m (PageWithState b)
paginateWithState q p = do
let p' = p {Protocol.pageSize = Protocol.pageSize p <|> Just 10000}
r <- runQ q p'
getResult r >>= \case
Protocol.RowsResult m b ->
return $ PageWithState b (pagingState m)
_ -> throwM $ UnexpectedResponse (hrHost r) (hrResponse r)

paramsPagingState :: Consistency -> a -> Int32 -> Maybe Protocol.PagingState -> QueryParams a
paramsPagingState c p n state = QueryParams c False p (Just n) state Nothing Nothing
{-# INLINE paramsPagingState #-}

pwsHasMore :: PageWithState a -> Bool
pwsHasMore = isJust . pwsState
2 changes: 2 additions & 0 deletions libs/hscim/CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0.3.4:
- initial version
36 changes: 23 additions & 13 deletions libs/hscim/hscim.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ cabal-version: 1.12
--
-- see: https://github.com/sol/hpack
--
-- hash: 427354dd7819ba82a24149dd338a58c577aa8b4ba3a1682d80de4c8f3c459049
-- hash: b8d0589f22bc168d16fa3a2b2800d9cc3b14b4d94bb911fe973ccf2a2025e5e5

name: hscim
version: 0.3.4
synopsis: ...
description: ...
version: 0.3.5
synopsis: hscim json schema and server implementation
description: The README file will answer all the questions you might have
category: Web
homepage: https://github.com/wireapp/hscim/README.md
bug-reports: https://github.com/wireapp/hscim/issues
homepage: https://github.com/wireapp/wire-server/libs/hscim/README.md
bug-reports: https://github.com/wireapp/wire-server/issues
author: Wire Swiss GmbH
maintainer: Wire Swiss GmbH <backend@wire.com>
copyright: (c) 2018 Wire Swiss GmbH
Expand All @@ -21,10 +21,12 @@ license-file: LICENSE
build-type: Simple
extra-source-files:
README.md
CHANGELOG

source-repository head
type: git
location: https://github.com/wireapp/hscim
location: https://github.com/wireapp/wire-server
subdir: hscim

library
exposed-modules:
Expand All @@ -38,6 +40,7 @@ library
Web.Scim.Class.Auth
Web.Scim.Class.Group
Web.Scim.Class.User
Web.Scim.Client
Web.Scim.ContentType
Web.Scim.Filter
Web.Scim.Handler
Expand Down Expand Up @@ -72,7 +75,7 @@ library
aeson >=1.4.5 && <1.5
, aeson-qq >=0.8.2 && <0.9
, attoparsec >=0.13.2 && <0.14
, base >=4.12 && <4.14
, base >=4.12 && <4.15
, bytestring >=0.10.8 && <0.11
, case-insensitive >=1.2.1.0 && <1.3
, email-validate >=2.3.2 && <2.4
Expand All @@ -93,11 +96,13 @@ library
, retry >=0.8.1.0 && <0.9
, scientific >=0.3.6 && <0.4
, servant >=0.16.2 && <0.19
, servant-client >=0.16.2 && <0.19
, servant-client-core >=0.16.2 && <0.19
, servant-server >=0.16.2 && <0.19
, stm >=2.5.0 && <2.6
, stm-containers >=1.1.0 && <1.2
, string-conversions >=0.4.0 && <0.5
, template-haskell >=2.14.0 && <2.16
, template-haskell >=2.14.0 && <2.17
, text >=1.2.3 && <1.3
, time >=1.8.0 && <1.10
, unordered-containers >=0.2.10 && <0.3
Expand All @@ -119,7 +124,7 @@ executable hscim-server
aeson >=1.4.5 && <1.5
, aeson-qq >=0.8.2 && <0.9
, attoparsec >=0.13.2 && <0.14
, base >=4.12 && <4.14
, base >=4.12 && <4.15
, bytestring >=0.10.8 && <0.11
, case-insensitive >=1.2.1.0 && <1.3
, email-validate >=2.3.2 && <2.4
Expand All @@ -141,11 +146,13 @@ executable hscim-server
, retry >=0.8.1.0 && <0.9
, scientific >=0.3.6 && <0.4
, servant >=0.16.2 && <0.19
, servant-client >=0.16.2 && <0.19
, servant-client-core >=0.16.2 && <0.19
, servant-server >=0.16.2 && <0.19
, stm >=2.5.0 && <2.6
, stm-containers >=1.1.0 && <1.2
, string-conversions >=0.4.0 && <0.5
, template-haskell >=2.14.0 && <2.16
, template-haskell >=2.14.0 && <2.17
, text >=1.2.3 && <1.3
, time >=1.8.0 && <1.10
, unordered-containers >=0.2.10 && <0.3
Expand All @@ -166,6 +173,7 @@ test-suite spec
Test.Class.UserSpec
Test.FilterSpec
Test.MiscSpec
Test.Schema.MetaSchemaSpec
Test.Schema.PatchOpSpec
Test.Schema.UserSpec
Paths_hscim
Expand All @@ -179,7 +187,7 @@ test-suite spec
aeson >=1.4.5 && <1.5
, aeson-qq >=0.8.2 && <0.9
, attoparsec >=0.13.2 && <0.14
, base >=4.12 && <4.14
, base >=4.12 && <4.15
, bytestring >=0.10.8 && <0.11
, case-insensitive >=1.2.1.0 && <1.3
, email-validate >=2.3.2 && <2.4
Expand All @@ -201,11 +209,13 @@ test-suite spec
, retry >=0.8.1.0 && <0.9
, scientific >=0.3.6 && <0.4
, servant >=0.16.2 && <0.19
, servant-client >=0.16.2 && <0.19
, servant-client-core >=0.16.2 && <0.19
, servant-server >=0.16.2 && <0.19
, stm >=2.5.0 && <2.6
, stm-containers >=1.1.0 && <1.2
, string-conversions >=0.4.0 && <0.5
, template-haskell >=2.14.0 && <2.16
, template-haskell >=2.14.0 && <2.17
, text >=1.2.3 && <1.3
, time >=1.8.0 && <1.10
, unordered-containers >=0.2.10 && <0.3
Expand Down
21 changes: 13 additions & 8 deletions libs/hscim/package.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
name: hscim
version: 0.3.4
synopsis: ...
description: ...
homepage: https://github.com/wireapp/hscim/README.md
version: 0.3.5
synopsis: hscim json schema and server implementation
description: The README file will answer all the questions you might have
homepage: https://github.com/wireapp/wire-server/libs/hscim/README.md
license: AGPL-3
license-file: LICENSE
author: Wire Swiss GmbH
maintainer: Wire Swiss GmbH <backend@wire.com>
copyright: (c) 2018 Wire Swiss GmbH
category: Web
build-type: Simple
github: wireapp/hscim
github: wireapp/wire-server/hscim
# TODO: should be `github: wireapp/wire-server/libs/hscim`, but hpack
# 0.33.0 doesn't allow that: https://github.com/sol/hpack/pull/451.
# (i think we should just move back to writing cabal files by hand.)

default-extensions:
- ConstraintKinds
Expand All @@ -32,19 +35,19 @@ default-extensions:

extra-source-files:
- README.md

- CHANGELOG

dependencies:
- aeson >= 1.4.5 && < 1.5
- attoparsec >= 0.13.2 && < 0.14
- bytestring >= 0.10.8 && < 0.11
- base >= 4.12 && < 4.14
- base >= 4.12 && < 4.15
- case-insensitive >= 1.2.1.0 && < 1.3
- scientific >= 0.3.6 && < 0.4
- hashable >= 1.2.7 && < 1.4
- text >= 1.2.3 && < 1.3
- time >= 1.8.0 && < 1.10
- template-haskell >= 2.14.0 && < 2.16
- template-haskell >= 2.14.0 && < 2.17
- unordered-containers >= 0.2.10 && < 0.3
- aeson-qq >= 0.8.2 && < 0.9
- mtl >= 2.2.2 && < 2.3
Expand All @@ -66,6 +69,8 @@ dependencies:
- network-uri >= 2.6.2 && < 2.7
- servant >= 0.16.2 && < 0.19
- servant-server >= 0.16.2 && < 0.19
- servant-client >= 0.16.2 && < 0.19
- servant-client-core >= 0.16.2 && < 0.19
- warp >= 3.2.28 && < 3.4
- stm-containers >= 1.1.0 && < 1.2
- string-conversions >= 0.4.0 && < 0.5
Expand Down
Loading