APISecurity constructor
APISecurity({})
Implementation
APISecurity({
Duration? tokenDuration,
int? tokenLength,
APIRoot? apiRoot,
SharedStoreField? sharedStoreField,
SharedStoreReference? sharedStoreReference,
SharedStore? sharedStore,
String? sharedStoreID,
SharedStoreProviderSync? storeProvider,
}) : tokenDuration = tokenDuration ?? Duration(hours: 3),
tokenLength = tokenLength != null && tokenLength > 32
? tokenLength
: 512,
_sharedStoreField =
SharedStoreField.tryFrom(
sharedStoreField: sharedStoreField,
sharedStoreReference: sharedStoreReference,
sharedStore: sharedStore ?? apiRoot?.sharedStore,
sharedStoreID: sharedStoreID,
storeProvider: storeProvider,
) ??
SharedStoreField.fromSharedStore(SharedStore.notShared()) {
_tokenStore = resolveTokensStore();
}