Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
signalboost
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
casper
signalboost
Commits
15274f9a
Verified
Commit
15274f9a
authored
5 years ago
by
aguestuser
Browse files
Options
Downloads
Patches
Plain Diff
[ns] add trust boost command
parent
d5fdb70c
Branches
ns-add-retrust-boost-command
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
cli/boost
+3
-1
3 additions, 1 deletion
cli/boost
cli/boost-commands/help
+3
-0
3 additions, 0 deletions
cli/boost-commands/help
cli/boost-commands/trust
+43
-0
43 additions, 0 deletions
cli/boost-commands/trust
with
49 additions
and
1 deletion
cli/boost
+
3
−
1
View file @
15274f9a
...
...
@@ -22,6 +22,7 @@ print_usage(){
echo
" list-channels"
echo
" list-numbers"
echo
" release-numbers"
echo
" trust"
echo
""
echo
"To learn what these commands do, run:"
echo
""
...
...
@@ -34,7 +35,8 @@ if [[ $command != "help" ]] &&
[[
$command
!=
"create-number"
]]
&&
[[
$command
!=
"list-channels"
]]
&&
[[
$command
!=
"list-numbers"
]]
&&
[[
$command
!=
"release-numbers"
]]
[[
$command
!=
"release-numbers"
]]
&&
[[
$command
!=
"trust"
]]
then
print_usage
exit
1
...
...
This diff is collapsed.
Click to expand it.
cli/boost-commands/help
+
3
−
0
View file @
15274f9a
...
...
@@ -21,6 +21,9 @@ boost cli supports the following commands:
release-numbers <path>
- releases all phone numbers with twilio ids listed at given path
trust <user phone number>
- trusts all safety numbers associated with a user's phone number
for more detailed instructions on any command, run:
boost <command> -h
...
...
This diff is collapsed.
Click to expand it.
cli/boost-commands/trust
0 → 100755
+
43
−
0
View file @
15274f9a
#!/usr/bin/env bash
if
[[
$1
==
"-h"
]]
||
[[
$1
==
"--help"
]]
;
then
echo
"this command trusts all safety numbers associated with a user's phone number. valid options are:"
echo
""
echo
"-p : user phone number"
;
echo
"-u : url to target (in dev, use signalboost.ngrok.io)"
;
echo
""
exit
1
fi
echo
"--- checking environment and args..."
if
[
-z
$SIGNALBOOST_API_TOKEN
]
;
then
echo
"--- ERROR: no SIGNALBOOST_API_TOKEN found. try
\`\$
set -a && source .env && set +a
\`
"
exit
1
fi
while
getopts
":p:n:s:u:"
opt
;
do
case
"
$opt
"
in
p
)
phone_number
=
"
$OPTARG
"
;;
u
)
url
=
"
$OPTARG
"
;;
esac
done
if
[[
!
$phone_number
=
~ ^
\+
(
1|52
)[
0-9]
{
10
}
$
]]
;
then
echo
"> ERROR: -p must be a 10 digit phone number prefixed by a country code (+1 or +52)"
exit
1
fi
if
[
-z
$url
]
;
then
url
=
${
SIGNALBOOST_HOST_URL
}
;
fi
echo
"--- trusting all safety numbers for user phone number
${
phone_number
}
at url
${
url
}
"
curl
-s
-X
POST
\
-H
"Content-Type: application/json"
\
-H
"Token:
$SIGNALBOOST_API_TOKEN
"
\
-d
"{
\"
memberPhoneNumber
\"
:
\"
$phone_number
\"
}"
\
https://
${
url
}
/channels | jq
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment