APISecurity constructor

APISecurity({
  1. Duration? tokenDuration,
  2. int? tokenLength,
  3. APIRoot? apiRoot,
  4. SharedStoreField? sharedStoreField,
  5. SharedStoreReference? sharedStoreReference,
  6. SharedStore? sharedStore,
  7. String? sharedStoreID,
  8. SharedStoreProviderSync? storeProvider,
})

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();
}