// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// https://github.com/fedidcg/FedCM/blob/main/proposals/context-api.md
enum IdentityCredentialRequestOptionsContext {
  "signin",
  "signup",
  "use",
  "continue"
};

enum IdentityCredentialRequestOptionsMode {
  "active",
  "passive"
};

// https://fedidcg.github.io/FedCM/#dictdef-identitycredentialrequestoptions
dictionary IdentityCredentialRequestOptions {
    required sequence<IdentityProviderRequestOptions> providers;
    IdentityCredentialRequestOptionsContext context = "signin";
    // Allows an RP to select between the two modes of operation: active or passive.
    [MeasureAs=FedCmButtonMode] IdentityCredentialRequestOptionsMode mode = "passive";
    // This is a debugging aid string instead of an actual member of this dictionary.
    // `mediation` could be accidentally set by web developers here and this helps
    // with showing debugging info to developers when it happens.
    USVString mediation;
};
