-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
Combine Handler into KeyManager, and also pass in KeyExtractor Options as a parameter instead of it being a separate instance. i.e. it's just the key store and token bucket implementation (that have different implementations) that need to be passed in.
before
const store = new InMemoryKeyStore()
const manager = new KeyManager(store)
const bucket = new InMemoryTokenBucket()
const extractor = new KeyExtractor({ searchParam: 'key', httpHeader: 'x-api-key' })
const handler = new Handler(extractor, manager, bucket)
export const handle = handler.handleafter
const store = new InMemoryKeyStore()
const bucket = new InMemoryTokenBucket()
const manager = new KeyManager(store, bucket, { searchParam: 'key', httpHeader: 'x-api-key' })
export const handle = manager.handleMetadata
Metadata
Assignees
Labels
No labels