Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Improve @fluidframework/test-client-utils API docs #10591

Merged
merged 21 commits into from
Jun 24, 2022
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
8d831b5
docs: Simplify type docs
Josmithr Jun 7, 2022
eedecd3
docs: API doc improvements and TODOs
Josmithr Jun 7, 2022
d65419c
docs: Add TODO
Josmithr Jun 7, 2022
ca10854
docs: Fill in TODO
Josmithr Jun 7, 2022
781a79a
docs: Remove bad link
Josmithr Jun 8, 2022
1204d4f
docs: Update API report
Josmithr Jun 8, 2022
d78fbf3
Merge branch 'main' into improve-test-client-utils-docs
Josmithr Jun 8, 2022
1df0c15
docs: Update API report
Josmithr Jun 8, 2022
a6dfe1b
Merge branch 'main' into improve-test-client-utils-docs
Josmithr Jun 9, 2022
68ca660
docs: Update comment (code review suggestion)
Josmithr Jun 13, 2022
e9c69bc
docs: Update capitalization (code review suggestion)
Josmithr Jun 13, 2022
61bb9b4
docs: Update comment (code review suggestion)
Josmithr Jun 13, 2022
3e31eba
docs: Add `routerlicious-driver` to published docs to allow inheritDo…
Josmithr Jun 17, 2022
4bddc36
Merge branch 'improve-test-client-utils-docs' of https://github.com/J…
Josmithr Jun 17, 2022
e4a7a91
Merge branch 'main' into improve-test-client-utils-docs
Josmithr Jun 17, 2022
d992104
docs: Clarify type docs (code review feedback)
Josmithr Jun 17, 2022
8d7c4aa
docs: Update comment (code review feedback)
Josmithr Jun 20, 2022
6c191a6
docs: Expand type documentation (code review suggestion)
Josmithr Jun 24, 2022
e651f61
Merge branch 'main' into improve-test-client-utils-docs
Josmithr Jun 24, 2022
2a3d1a7
docs: Update comment
Josmithr Jun 24, 2022
cfe519d
docs: Update comment
Josmithr Jun 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion api-report/test-runtime-utils.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ export interface IMockContainerRuntimePendingMessage {

// @public
export class InsecureTokenProvider implements ITokenProvider {
constructor(tenantKey: string, user: IUser);
constructor(
tenantKey: string,
user: IUser);
Josmithr marked this conversation as resolved.
Show resolved Hide resolved
// (undocumented)
fetchOrdererToken(tenantId: string, documentId?: string): Promise<ITokenResponse>;
// (undocumented)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,6 @@ export interface IUploadedSummaryDetails {

// @public
export interface IUser {
// (undocumented)
id: string;
}

Expand Down
3 changes: 3 additions & 0 deletions common/lib/protocol-definitions/src/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@
* Base user definition. It is valid to extend this interface when adding new details to the user object.
*/
export interface IUser {
/**
* Unique identifier of the user session. This ID is established on each connection with the service.
*/
id: string;
}
1 change: 1 addition & 0 deletions docs/rollup-api-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const websitePackages = [
"@fluidframework/map",
"@fluidframework/sequence",
"@fluidframework/fluid-static",
"@fluidframework/routerlicious-driver",
"@fluidframework/test-client-utils",
"@fluidframework/tinylicious-client",
];
Expand Down
3 changes: 1 addition & 2 deletions packages/drivers/routerlicious-driver/src/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ export interface ITokenResponse {
}

/**
* The ITokenProvider abstracts the token fetching mechanism for a host. Host will be responsible for
* implementing the interfaces.
* Abstracts the token fetching mechanism for a hosting application. The hosting application will be responsible for providing an implementation.
*/
export interface ITokenProvider {
/**
Expand Down
4 changes: 3 additions & 1 deletion packages/framework/test-client-utils/src/generateTestUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import generateName from "sillyname";
import { v4 as uuid } from "uuid";

/**
* Create a new user object with a unique id (uuid) and random name (FIRST LAST)
* Create a new user object with a unique id
* ({@link https://en.wikipedia.org/wiki/Universally_unique_identifier | uuid}) and random name (FIRST LAST)
*
* @returns a user object with a name and id property
*/
export const generateTestUser = (): IUser & { name: string; } => {
Expand Down
18 changes: 16 additions & 2 deletions packages/runtime/test-runtime-utils/src/insecureTokenProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,28 @@ import { ITokenProvider, ITokenResponse } from "@fluidframework/routerlicious-dr
import { generateToken } from "./generateToken";

/**
* As the name implies this is not secure and should not be used in production. It simply makes the example easier
* to get up and running.
* {@link @fluidframework/routerlicious-driver#ITokenProvider} intended for **test use only**.
Josmithr marked this conversation as resolved.
Show resolved Hide resolved
* As the name implies this is not secure and should not be used in production.
* It simply makes examples where authentication is not relevant easier to bootstrap.
*/
export class InsecureTokenProvider implements ITokenProvider {
constructor(
/**
* TODO
Josmithr marked this conversation as resolved.
Show resolved Hide resolved
*/
Josmithr marked this conversation as resolved.
Show resolved Hide resolved
private readonly tenantKey: string,

/**
* User with whom generated tokens will be associated.
Josmithr marked this conversation as resolved.
Show resolved Hide resolved
*/
private readonly user: IUser,
) {

}

/**
* {@inheritDoc @fluidframework/routerlicious-driver#ITokenProvider.fetchOrdererToken}
Josmithr marked this conversation as resolved.
Show resolved Hide resolved
*/
public async fetchOrdererToken(tenantId: string, documentId?: string): Promise<ITokenResponse> {
return {
fromCache: true,
Expand All @@ -36,6 +47,9 @@ export class InsecureTokenProvider implements ITokenProvider {
};
}

/**
* {@inheritDoc @fluidframework/routerlicious-driver#ITokenProvider.fetchStorageToken}
*/
public async fetchStorageToken(tenantId: string, documentId: string): Promise<ITokenResponse> {
return {
fromCache: true,
Expand Down