summaryrefslogtreecommitdiffstats
path: root/toolkit/components/credentialmanagement/nsIIdentityCredentialStorageService.idl
blob: 0d993549e32559a481643a08f2ee54f38a35fe86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "nsISupports.idl"
#include "nsIPrincipal.idl"

webidl IdentityCredential;

[scriptable, builtinclass, uuid(029823d0-0448-46c5-af1f-25cd4501d0d7)]
interface nsIIdentityCredentialStorageService : nsISupports {
    // Store the registered and allowLogout bit for the tuple (rpPrincipal, idpPrincipal, credentialID).
    // This goes straight to disk if rpPrincipal is not in Private Browsing mode and stays in memory otherwise.
    // Additionally, if rpPrincipal is private, it will be cleared when the user closes the last private browsing window.
    void setState(in nsIPrincipal rpPrincipal, in nsIPrincipal idpPrincipal, in ACString credentialID, in boolean registered, in boolean allowLogout);

    // Retrieve the registered and allowLogout bits for the tuple (rpPrincipal, idpPrincipal, credentialID).
    // This will always return defaults, even if there was never a value stored or it was deleted.
    void getState(in nsIPrincipal rpPrincipal, in nsIPrincipal idpPrincipal, in ACString credentialID, out boolean registered, out boolean allowLogout);

    // Delete the entry for the tuple (rpPrincipal, idpPrincipal, credentialID).
    void delete(in nsIPrincipal rpPrincipal, in nsIPrincipal idpPrincipal, in ACString credentialID);

    // Delete all data in this service.
    void clear();

    // Delete all data stored under a tuple with rpPrincipal that has the given base domain
    void deleteFromBaseDomain(in ACString baseDomain);

    // Delete all data stored under a tuple with a given rpPrincipal
    void deleteFromPrincipal(in nsIPrincipal rpPrincipal);

    // Delete all data stored in the given time range (microseconds since epoch)
    void deleteFromTimeRange(in PRTime aFrom, in PRTime aTo);

    // Delete all data matching the given Origin Attributes pattern
    void deleteFromOriginAttributesPattern(in AString aPattern);
};