-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WPB-8702 Retrieve in database users that can only login with Phone Nu…
…mbers & SMS to login (#4024)
- Loading branch information
1 parent
ee762a0
commit 69411da
Showing
10 changed files
with
579 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add tool to determine number of phone-only users |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../.ormolu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Phone users | ||
|
||
This program scans brig's users table and determines the number of users that can only login by phone/sms. | ||
|
||
Example usage: | ||
|
||
```shell | ||
phone-users --brig-cassandra-keyspace brig --galley-cassandra-keyspace galley -l 100000 | ||
``` | ||
|
||
Display usage: | ||
|
||
```shell | ||
phone-users -h | ||
``` | ||
|
||
```text | ||
phone-users | ||
Usage: phone-users [--brig-cassandra-host HOST] [--brig-cassandra-port PORT] | ||
[--brig-cassandra-keyspace STRING] | ||
[--galley-cassandra-host HOST] [--galley-cassandra-port PORT] | ||
[--galley-cassandra-keyspace STRING] [-l|--limit INT] | ||
This program scans brig's users table and determines the number of users that | ||
can only login by phone/sms | ||
Available options: | ||
-h,--help Show this help text | ||
--brig-cassandra-host HOST | ||
Cassandra Host for brig (default: "localhost") | ||
--brig-cassandra-port PORT | ||
Cassandra Port for brig (default: 9042) | ||
--brig-cassandra-keyspace STRING | ||
Cassandra Keyspace for brig (default: "brig_test") | ||
--galley-cassandra-host HOST | ||
Cassandra Host for galley (default: "localhost") | ||
--galley-cassandra-port PORT | ||
Cassandra Port for galley (default: 9043) | ||
--galley-cassandra-keyspace STRING | ||
Cassandra Keyspace for galley | ||
(default: "galley_test") | ||
-l,--limit INT Limit the number of users to process | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
-- This file is part of the Wire Server implementation. | ||
-- | ||
-- Copyright (C) 2024 Wire Swiss GmbH <[email protected]> | ||
-- | ||
-- This program is free software: you can redistribute it and/or modify it under | ||
-- the terms of the GNU Affero General Public License as published by the Free | ||
-- Software Foundation, either version 3 of the License, or (at your option) any | ||
-- later version. | ||
-- | ||
-- This program is distributed in the hope that it will be useful, but WITHOUT | ||
-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
-- FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more | ||
-- details. | ||
-- | ||
-- You should have received a copy of the GNU Affero General Public License along | ||
-- with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
module Main where | ||
|
||
import qualified PhoneUsers.Lib as Lib | ||
|
||
main :: IO () | ||
main = Lib.main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# WARNING: GENERATED FILE, DO NOT EDIT. | ||
# This file is generated by running hack/bin/generate-local-nix-packages.sh and | ||
# must be regenerated whenever local packages are added or removed, or | ||
# dependencies are added or removed. | ||
{ mkDerivation | ||
, aeson | ||
, aeson-pretty | ||
, base | ||
, bytestring | ||
, cassandra-util | ||
, conduit | ||
, cql | ||
, gitignoreSource | ||
, imports | ||
, lens | ||
, lib | ||
, optparse-applicative | ||
, time | ||
, tinylog | ||
, types-common | ||
, wire-api | ||
}: | ||
mkDerivation { | ||
pname = "phone-users"; | ||
version = "1.0.0"; | ||
src = gitignoreSource ./.; | ||
isLibrary = true; | ||
isExecutable = true; | ||
libraryHaskellDepends = [ | ||
aeson | ||
aeson-pretty | ||
bytestring | ||
cassandra-util | ||
conduit | ||
cql | ||
imports | ||
lens | ||
optparse-applicative | ||
time | ||
tinylog | ||
types-common | ||
wire-api | ||
]; | ||
executableHaskellDepends = [ base ]; | ||
description = "Check users that are only able to login via phone"; | ||
license = lib.licenses.agpl3Only; | ||
mainProgram = "phone-users"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
cabal-version: 3.0 | ||
name: phone-users | ||
version: 1.0.0 | ||
synopsis: Check users that are only able to login via phone | ||
category: Network | ||
author: Wire Swiss GmbH | ||
maintainer: Wire Swiss GmbH <[email protected]> | ||
copyright: (c) 2024 Wire Swiss GmbH | ||
license: AGPL-3.0-only | ||
build-type: Simple | ||
|
||
library | ||
hs-source-dirs: src | ||
exposed-modules: | ||
PhoneUsers.Lib | ||
PhoneUsers.Types | ||
|
||
ghc-options: | ||
-O2 -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates | ||
-Wpartial-fields -fwarn-tabs -optP-Wno-nonportable-include-path | ||
-funbox-strict-fields -threaded -with-rtsopts=-N | ||
-Wredundant-constraints -Wunused-packages | ||
|
||
build-depends: | ||
, aeson | ||
, aeson-pretty | ||
, bytestring | ||
, cassandra-util | ||
, conduit | ||
, cql | ||
, imports | ||
, lens | ||
, optparse-applicative | ||
, time | ||
, tinylog | ||
, types-common | ||
, wire-api | ||
|
||
default-extensions: | ||
AllowAmbiguousTypes | ||
BangPatterns | ||
ConstraintKinds | ||
DataKinds | ||
DefaultSignatures | ||
DeriveFunctor | ||
DeriveGeneric | ||
DeriveLift | ||
DeriveTraversable | ||
DerivingStrategies | ||
DerivingVia | ||
DuplicateRecordFields | ||
EmptyCase | ||
FlexibleContexts | ||
FlexibleInstances | ||
FunctionalDependencies | ||
GADTs | ||
GeneralizedNewtypeDeriving | ||
InstanceSigs | ||
KindSignatures | ||
LambdaCase | ||
MultiParamTypeClasses | ||
MultiWayIf | ||
NamedFieldPuns | ||
NoImplicitPrelude | ||
OverloadedLabels | ||
OverloadedRecordDot | ||
OverloadedStrings | ||
PackageImports | ||
PatternSynonyms | ||
PolyKinds | ||
QuasiQuotes | ||
RankNTypes | ||
RecordWildCards | ||
ScopedTypeVariables | ||
StandaloneDeriving | ||
TupleSections | ||
TypeApplications | ||
TypeFamilies | ||
TypeFamilyDependencies | ||
TypeOperators | ||
UndecidableInstances | ||
ViewPatterns | ||
|
||
executable phone-users | ||
main-is: Main.hs | ||
build-depends: | ||
, base | ||
, phone-users | ||
|
||
hs-source-dirs: app | ||
default-language: Haskell2010 | ||
ghc-options: | ||
-O2 -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates | ||
-Wpartial-fields -fwarn-tabs -optP-Wno-nonportable-include-path | ||
-funbox-strict-fields -threaded -with-rtsopts=-N | ||
-Wredundant-constraints -Wunused-packages |
Oops, something went wrong.