Skip to content

Added miscellaneous category to documentation #1358

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,10 @@ DynamoDB

examples/dynamo_db/insertions
examples/dynamo_db/tables

Cognito Identity Provider
--------
Copy link
Collaborator

Choose a reason for hiding this comment

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

To improve readability, the dashes should repeat for the entire width of the heading.

.. toctree::
:maxdepth: 2

examples/cognito_idp/forgot_password.rst
Copy link
Collaborator

Choose a reason for hiding this comment

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

To maintain the convention used for other links, please remove the .rst suffix.

11 changes: 11 additions & 0 deletions docs/examples/cognito_idp/forgot_password.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Cognito Identity Provider
Copy link
Collaborator

Choose a reason for hiding this comment

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

The heading should be descriptive of the example - to play nicely with the table of contents. In this case: Forgot Password

-------------------

Amazon Cognito Identity Provider (IdP) allows you to manage user authentication and user management for your applications.

We will demonstrate usage with the Cognito forgot password feature.

.. note::
Copy link
Collaborator

Choose a reason for hiding this comment

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

The note does not add much value and may be removed.

This example shows how to use the Cognito forgot password feature.

.. literalinclude:: ../../../examples/cognito_idp_forgot_password.py
31 changes: 31 additions & 0 deletions examples/cognito_idp_forgot_password.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Boto should get credentials from ~/.aws/credentials or the environment
import asyncio

from aiobotocore.session import get_session


async def go():
session = get_session()
async with session.create_client(
'cognito-idp',
region_name='us-west-2',
) as client:
# initiate forgot password
resp = await client.forgot_password(
ClientId='xxx',
Username='xxx',
)
print(resp)

# confirm forgot password
resp = await client.confirm_forgot_password(
ClientId='xxx',
Username='xxx',
ConfirmationCode='xxx',
Password='xxx',
)
print(resp)


if __name__ == '__main__':
asyncio.run(go())
Loading