66
77Get the latest version of the ` docker-compose.yaml ` file:
88
9- And add secure Token(s) to ` API__TOKEN ` / ` API__TOKENS ` . See [ API\_\_ TOKEN (s)] ( #api-tokens )
9+ And add secure Token(s) to ` API__TOKEN ` / ` API__TOKENS ` . See [ API TOKEN (s)] ( #api-tokens )
1010
1111> [ !IMPORTANT]
1212> This Documentation will be using ` sec-signal-api:8880 ` as the service host,
13- > this ** won't work ** , instead use your containers IP + Port.
13+ > this ** is just for simplicty ** , instead use your containers or hosts IP + Port.
1414> Or a hostname if applicable. See [ Reverse Proxy] ( #reverse-proxy )
1515
1616``` yaml
@@ -47,20 +47,20 @@ Secured Signal API provides 3 Ways to Authenticate
4747
4848### Bearer
4949
50- To Authenticate add ` Authorization: Bearer API__TOKEN ` to your request Headers
50+ To Authenticate add ` Authorization: Bearer API_TOKEN ` to your request Headers
5151
5252### Basic Auth
5353
5454To use Basic Auth as Authorization Method add ` Authorization: Basic BASE64_STRING ` to your Headers
5555
5656User is ` api ` (LOWERCASE)
5757
58- Formatting for ` BASE64_STRING ` = ` user:API__TOKEN ` .
58+ Formatting for ` BASE64_STRING ` = ` user:API_TOKEN ` .
5959
6060example:
6161
6262``` bash
63- echo " api:API__TOKEN " | base64
63+ echo " api:API_TOKEN " | base64
6464```
6565
6666=> ` YXBpOkFQSV9LRVkK `
@@ -73,17 +73,17 @@ in this case you can use **Query Auth**.
7373Here is a simple example:
7474
7575``` bash
76- curl -X POST http://sec-signal-api:8880/v2/send? @authorization=API__TOKEN
76+ curl -X POST http://sec-signal-api:8880/v2/send? @authorization=API_TOKEN
7777```
7878
79- Notice the ` @ ` infront of ` authorization ` . See [ Formatting ] ( #format ) .
79+ Notice the ` @ ` infront of ` authorization ` . See [ KeyValue Pair Injection ] ( #keyvalue-pair-injection ) .
8080
8181### Example
8282
8383To send a message to 1234567:
8484
8585``` bash
86- curl -X POST -H " Content-Type: application/json" -H " Authorization: Bearer API__TOKEN " -d ' {"message": "Hello World!", "recipients": ["1234567"]}' http://sec-signal-api:8880/v2/send
86+ curl -X POST -H " Content-Type: application/json" -H " Authorization: Bearer API_TOKEN " -d ' {"message": "Hello World!", "recipients": ["1234567"]}' http://sec-signal-api:8880/v2/send
8787```
8888
8989### Advanced
@@ -121,34 +121,41 @@ http://sec-signal-api:8880/v1/receive/{{.NUMBER}}
121121
122122In some cases you may not be able to access / modify the Request Body, in that case specify needed values in the Request Query:
123123
124- Supported types include ** strings** , ** ints** and ** arrays**
125-
126124` http://sec-signal-api:8880/?@key=value `
127125
128- | type | example |
129- | :--------- | :------ |
130- | string | abc |
131- | int | 123 |
132- | array | [ 1,2,3] |
133- | array(int) | 1,2,3 |
134- | array(str) | a,b,c |
135-
136- ##### Format
137-
138126In order to differentiate Injection Queries and _ regular_ Queries
139127you have to add ` @ ` in front of any KeyValue Pair assignment.
140128
129+ Supported types include ** strings** , ** ints** and ** arrays** . See [ Formatting] ( #string-to-type ) .
130+
141131## Environment Variables
142132
133+ ### String To Type
134+
135+ In the Environment the only allowed type is a string so to not have to always use a json string you can use the following types,
136+ if you format them correctly...
137+
138+ | type | example |
139+ | :--------- | :---------------- |
140+ | string | abc |
141+ | string | +123 |
142+ | int | 123 |
143+ | int | -123 |
144+ | json | {"a":"b","c":"d"} |
145+ | array(int) | [ 1,2,3] |
146+ | array(str) | [ a,b,c] |
147+
148+ This formatting applies to almost every situation where the only (allowed) Input Type is a string and other Output Types are needed.
149+
143150### API Token(s)
144151
145- Both ` API__TOKEN ` and ` API__TOKENS ` support multiple Tokens seperated by a ` , ` ** Comma** .
152+ Both ` API__TOKEN ` and ` API__TOKENS ` support multiple Tokens seperated by a ` , ` ** Comma** and ` [] ` ** Brackets ** . See [ Formatting ] ( #string-to-type ) .
146153During Authentication Secured Signal API will try to match the given Token against the list of Tokens inside of these Variables.
147154
148155``` yaml
149156environment :
150- API__TOKEN : " token1, token2, token3"
151- API__TOKENS : " token1, token2, token3"
157+ API__TOKEN : [ token1, token2, token3]
158+ API__TOKENS : [ token1, token2, token3]
152159` ` `
153160
154161> [!IMPORTANT]
@@ -215,7 +222,7 @@ Set this Environment Variable to automatically provide default Recipients:
215222` ` ` yaml
216223environment:
217224 RECIPIENTS: |
218- user.id, 000, 001, group.id,
225+ [ user.id, 000, 001, group.id ]
219226` ` `
220227
221228example :
0 commit comments