authenzify
Version:
server to manage authentication authorization of users and more
96 lines (77 loc) • 3.74 kB
Markdown
#Authenzify
- This repository is not ready yet, is on progress. Please do not use it yet.
- Generate keys example:
- openssl ecparam -name prime256v1 -genkey -noout -out ec-private-key.pem
- openssl ec -in ec-private-key.pem -pubout -out ec-public-key.pem
- config file:
/\*\*
* {Object} JwtOptions
* {string} issuer - JWT issuer (e.g. company name)
* {string} subject - JWT subject (e.g. user email)
* {string} audience - JWT audience (e.g. service URL)
* {string|number} expiresIn - Token expiration time (e.g. '12h')
* {string} algorithm - JWT algorithm, e.g. 'ES256'
\*/
/\*\*
- {Object} StorageOptions
- {string} dbName - Name of the MongoDB database
- {Object.<string, any>} [otherOptions] - Additional options
\*/
/\*\*
- {Object} StorageConfig
- {'mongodb'} type - Type of storage (currently only MongoDB supported)
- {string} uri - MongoDB connection URI
- {StorageOptions} options - Additional storage options
\*/
/\*\*
- {Object} EmailTemplatePaths
- {string} from - Path to the "from" template
- {string} html - Path to the HTML body template
- {string} subject - Path to the subject template
\*/
/\*\*
- {Object} EmailTemplates
- {EmailTemplatePaths} activation
- {EmailTemplatePaths} forgotPassword
- {EmailTemplatePaths} onVerification
- {EmailTemplatePaths} permissionsRequest
- {EmailTemplatePaths} permissionsApprovedToUser
\*/
/\*\*
- {Object} EmailProviderSettings
- {string} from - Default sender email
- {string} host - SMTP host (e.g. 'gmail')
- {number} port - SMTP port
- {boolean} secure - Whether to use TLS
- {{ user: string, pass: string }} auth - Authentication details
\*/
/\*\*
- {Object} EmailProvider
- {string} provider - Email provider name (e.g. 'nodemailer')
- {EmailProviderSettings} settings
- {EmailTemplates} emailTemplates
\*/
/\*\*
- {Object} UsersManagementServerConfig
- {string[]} onSignUpFirstBasePermissions - Default permissions assigned at sign-up
- {string} clientDomain - Public domain for client
- {string} applicationName - Application name
- {string} activationVerificationRoute - URL route for activation link
- {string} domain - API or frontend domain
- {string} activateUserBy - Mode of user activation (from ACTIVATE_USER_BY)
- {string} passwordPolicy - Regex pattern for valid passwords
- {string} usernamePolicy - Optional username policy (empty if not enforced)
- {StorageConfig} storage - Storage configuration (e.g. MongoDB)
- {number} saltLength - Salt length for password hashing
- {string} passwordPrivateKey - Key used in password encryption
- {string} privateKey - JWT signing private key
- {string} publicKey - JWT verification public key
- {JwtOptions} jwtOptions - JWT-related settings
- {string} authorizationCookieKey - Cookie key for storing JWT
- {boolean} setCookieOnSignIn - Whether to set cookie after sign-in
- {EmailProvider} emailProvider - Email provider settings and templates
- {boolean|Object} logger - Logging config or false if disabled
- {string} resetPasswordRoute - Reset password verification URL
- {string} didNotAskedToResetPasswordRoute - Alternate route if user didn’t request reset
- {Object.<string, any>} [customOverrides] - Additional config overrides
\*/