feat: add API token authentication (closes #87) #94

Closed
clawbot wants to merge 4 commits from feature/api-token-auth into main
Showing only changes of commit a891fb2489 - Show all commits

View File

@@ -15,7 +15,7 @@ import (
) )
// tokenRandomBytes is the number of random bytes for token generation. // tokenRandomBytes is the number of random bytes for token generation.
const tokenRandomBytes = 16 const tokenRandomBytes = 32

16 random bytes = 128 bits of entropy. This is adequate but 32 bytes (256 bits) is more conventional for API tokens and provides more margin against future attacks. Low priority.

16 random bytes = 128 bits of entropy. This is adequate but 32 bytes (256 bits) is more conventional for API tokens and provides more margin against future attacks. Low priority.
// tokenPrefix is prepended to generated API tokens. // tokenPrefix is prepended to generated API tokens.
const tokenPrefix = "upaas_" const tokenPrefix = "upaas_"