Skip to content

Commit 0ce2a21

Browse files
committed
finish doc
1 parent d8370de commit 0ce2a21

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
HMAC auth helper for Squid.
44

5-
TODO: Tell about format and idea.
5+
basic\_hmac\_auth helper enables Squid basic authentication with HMAC-signatures passed as username and password. In that scheme username represents user login as usual and password should be constructed as follows: *password := urlsafe\_base64\_without\_padding(expire\_timestamp || hmac\_sha256(secret, "dumbproxy grant token v1" || username || expire\_timestamp))*, where *expire_timestamp* is 64-bit big-endian UNIX timestamp and *||* is a concatenation operator. [This Python script](https://gist.github.com/Snawoot/2b5acc232680d830f0f308f14e540f1d) can be used as a reference implementation of signing.
66

77
## Usage
88

9-
This auth helper can be used with configuration like this:
9+
This auth helper can be used with Squid configuration like this:
1010

1111
```
12-
auth_param basic program /usr/local/bin/basic_hmac_auth -secret 1be3ada09688ca3c4a674a7d2e285a5a04ee423e082ae6c6b91946e2853af239
12+
auth_param basic program /usr/local/bin/basic_hmac_auth -secret <INSERT YOUR SECRET HERE>
1313
auth_param basic children 8 startup=8 idle=8 concurrency=50
1414
auth_param basic credentialsttl 15 minutes
1515
auth_param basic casesensitive on
@@ -18,6 +18,8 @@ http_access allow authenticated
1818
http_access deny all
1919
```
2020

21+
Secret key can be generated with following command: `openssl rand -hex 32`
22+
2123
> [!IMPORTANT]
2224
> Note that this helper works **only** with concurrent helper protocol, so `concurrency=` parameter **must** be greater than zero.
2325

0 commit comments

Comments
 (0)