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

chore: add topics and disposable token code snippets for dev docs #484

Merged
merged 6 commits into from
Sep 13, 2023

Conversation

anitarua
Copy link
Contributor

@anitarua anitarua commented Sep 11, 2023

Addresses #453 by adding code snippet for GenerateDisposableToken that will be pulled into the dev docs. This snippet can be used here and here.

Addresses #459 by adding code snippets for instantiating a topic client, publishing to a topic, and subscribing to a topic. These examples will be used on this page.

@anitarua anitarua marked this pull request as ready for review September 11, 2023 23:14
@anitarua anitarua requested a review from a team September 11, 2023 23:15
@anitarua anitarua changed the title chore: add disposable token code snippet for dev docs chore: add topics and disposable token code snippets for dev docs Sep 12, 2023

// Generate a disposable token with read-only access to all topics in one cache
var allTopicsOneCacheToken = await authClient.GenerateDisposableTokenAsync(
DisposableTokenScopes.TopicSubscribeOnly(CacheSelector.ByName("squirrel"), TopicSelector.AllTopics),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one can be changed to remove CacheSelector.ByName once the additional predefined scope functions are released

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding those!

@pgautier404
Copy link
Contributor

This LGTM! I think @nand4011 should take a look at the Topic examples before you merge, and if he's good with it, :shipit:

examples/DocExampleApis/Program.cs Outdated Show resolved Hide resolved
examples/DocExampleApis/Program.cs Outdated Show resolved Hide resolved
@anitarua anitarua requested a review from nand4011 September 13, 2023 19:00
@anitarua anitarua merged commit 4678836 into main Sep 13, 2023
7 checks passed
@anitarua anitarua deleted the disposable-tokens-docs-example branch September 13, 2023 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants