blob: 4c565f365d030d93bfec54b1b685d64c55356cb7 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@available(added=7)
library fuchsia.auth.oldtokens;
/// The id of a user linked to this device, alongside the current access token
/// to make requests on the user's behalf.
type Credential = table {
/// Opaque id for the user with which this credential is associated. It is
/// stable across reconnections to the CredentialsProducer protocol.
1: user_id string;
/// OAuth2 access token for this user.
2: access_token string;
};
/// Clients can connect to this protocol to subscribe to changes in the set of
/// users linked to this device, as well as the OAuth2 access token associated
/// with each.
///
/// This protocol won't be supported on the majority of devices, and shouldn't
/// be used without permission from its maintainers.
@discoverable
protocol CredentialsProducer {
/// Get the set of users linked to this device, and their corresponding access
/// tokens. While the connection to the service remains uninterrumpted, the
/// method call hangs if it would return the same response as the previous
/// time it was called by this client. In other words, if the client already
/// has the most up-to-date credentials, the method acts as a hanging get and
/// only returns when there's an update to report.
GetUpdatedCredentials() -> (struct {
credentials vector<Credential>;
});
};