fromSecretsStore static method

Future<ModelRolesResolver> fromSecretsStore(
  1. ModelRolesConfig config,
  2. SecretsStore store, {
  3. String? cwd,
  4. String? homeDir,
  5. void onNotice(
    1. FallbackNotice notice
    )?,
  6. DateTime now()?,
  7. double jitterFraction()?,
  8. Future<bool> sleeper(
    1. Duration delay,
    2. CancelToken? cancelToken
    )?,
  9. StreamFunction streamFactory(
    1. String kind,
    2. String apiKey
    )?,
})

Builds a resolver from a SecretsStore (reads the bulk snapshot once).

Implementation

static Future<ModelRolesResolver> fromSecretsStore(
  ModelRolesConfig config,
  SecretsStore store, {
  String? cwd,
  String? homeDir,
  void Function(FallbackNotice notice)? onNotice,
  DateTime Function()? now,
  double Function()? jitterFraction,
  Future<bool> Function(Duration delay, CancelToken? cancelToken)? sleeper,
  StreamFunction Function(String kind, String apiKey)? streamFactory,
}) async {
  return ModelRolesResolver(
    config: config,
    secrets: await store.readAll(),
    cwd: cwd,
    homeDir: homeDir,
    onNotice: onNotice,
    now: now,
    jitterFraction: jitterFraction,
    sleeper: sleeper,
    streamFactory: streamFactory,
  );
}