microsoft/vscode-react-native

Public

mirrored from https://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
0.6.8

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/extension/appcenter/auth/tokenStore/tokenStore.ts

37lines · modeblame

0c0b4844max-mironov8 years ago1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for details.
3
4import { Observable } from "rx-lite";
5import * as Q from "q";
6
7export interface TokenStore {
8// List all entries in the store for our project
9list(): Observable<TokenEntry>;
10
11// Get a specific token
12get(key: TokenKeyType): Q.Promise<TokenEntry | null>;
13
14// Add or update a token
15set(key: TokenKeyType, token: TokenValueType): Q.Promise<void>;
16
17// Remove a token
18remove(key: TokenKeyType): Q.Promise<void> ;
19}
20
21// Information stored about in each token
22export interface TokenEntry {
23key: TokenKeyType;
24accessToken: TokenValueType;
25}
26
27export interface TokenValueType {
28token: string;
29}
30
31//
32// Object used as token keys.
33// Right now just a string, prepping for when we hook up to
34// AAD and have to use ADAL tokens.
35//
36export type TokenKeyType = string;
37