MCPcopy Index your code
hub / github.com/LionC/express-basic-auth / IAuthorizerOptions

Interface IAuthorizerOptions

express-basic-auth.d.ts:102–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100 }
101
102 interface IAuthorizerOptions extends IBaseOptions {
103 /**
104 * Set to true if your authorizer is asynchronous.
105 */
106 authorizeAsync?: false
107
108 /**
109 * You can pass your own authorizer function, to check the credentials however you want.
110 * It will be called with a username and password and is expected to return true or false to indicate that the
111 * credentials were approved or not:
112 *
113 * Example:
114 * app.use(basicAuth({ authorizer }))
115 *
116 * function myAuthorizer(username: string, password: string) {
117 * return username.startsWith('A') && password.startsWith('secret');
118 * }
119 *
120 * This will authorize all requests with credentials where the username begins with 'A' and the password begins
121 * with 'secret'. In an actual application you would likely look up some data instead ;-)
122 */
123 authorizer: Authorizer
124 }
125
126 interface IAsyncAuthorizerOptions extends IBaseOptions {
127 /**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…