Skip to content

Commit

Permalink
Reinclude RequiredAttributes interface
Browse files Browse the repository at this point in the history
  • Loading branch information
arnulfojr committed May 21, 2020
1 parent 9e8c45f commit fac3355
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 2 deletions.
110 changes: 110 additions & 0 deletions packages/@aws-cdk/aws-cognito/lib/user-pool-attr.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,113 @@
/**
* The set of standard attributes that can be marked as required.
*
* @deprecated use {@link StandardAttributes}
* @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html#cognito-user-pools-standard-attributes
*/
export interface RequiredAttributes {
/**
* Whether the user's postal address is a required attribute.
* @default - Attribute is not required
*/
readonly address?: boolean;

/**
* Whether the user's birthday, represented as an ISO 8601:2004 format, is a required attribute.
* @default - Attribute is not required
*/
readonly birthdate?: boolean;

/**
* Whether theb user's e-mail address, represented as an RFC 5322 [RFC5322] addr-spec, is a required attribute.
* @default - Attribute is not required
*/
readonly email?: boolean;

/**
* Whether the surname or last name of the user is a required attribute.
* @default - Attribute is not required
*/
readonly familyName?: boolean;

/**
* Whether the user's gender is a required attribute.
* @default - Attribute is not required
*/
readonly gender?: boolean;

/**
* Whether the user's first name or give name is a required attribute.
* @default - Attribute is not required
*/
readonly givenName?: boolean;

/**
* Whether the user's locale, represented as a BCP47 [RFC5646] language tag, is a required attribute.
* @default - Attribute is not required
*/
readonly locale?: boolean;

/**
* Whether the user's middle name is a required attribute.
* @default - Attribute is not required
*/
readonly middleName?: boolean;

/**
* Whether user's full name in displayable form, including all name parts, titles and suffixes, is a required attibute.
* @default - Attribute is not required
*/
readonly fullname?: boolean;

/**
* Whether the user's nickname or casual name is a required attribute.
* @default - Attribute is not required
*/
readonly nickname?: boolean;

/**
* Whether the user's telephone number is a required attribute.
* @default - Attribute is not required
*/
readonly phoneNumber?: boolean;

/**
* Whether the URL to the user's profile picture is a required attribute.
* @default - Attribute is not required
*/
readonly profilePicture?: boolean;

/**
* Whether the user's preffered username, different from the immutable user name, is a required attribute.
* @default - Attribute is not required
*/
readonly preferredUsername?: boolean;

/**
* Whether the URL to the user's profile page is a required attribute.
* @default - Attribute is not required
*/
readonly profilePage?: boolean;

/**
* Whether the user's time zone is a required attribute.
* @default - Attribute is not required
*/
readonly timezone?: boolean;

/**
* Whether the time, the user's information was last updated, is a required attribute.
* @default - Attribute is not required
*/
readonly lastUpdateTime?: boolean;

/**
* Whether the URL to the user's web page or blog is a required attribute.
* @default - Attribute is not required
*/
readonly website?: boolean;
}

/**
* The set of standard attributes that can be marked as required or mutable.
*
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-cognito/lib/user-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { IRole, PolicyDocument, PolicyStatement, Role, ServicePrincipal } from '
import * as lambda from '@aws-cdk/aws-lambda';
import { Construct, Duration, IResource, Lazy, Resource, Stack } from '@aws-cdk/core';
import { CfnUserPool } from './cognito.generated';
import { ICustomAttribute, StandardAttributes } from './user-pool-attr';
import { ICustomAttribute, RequiredAttributes, StandardAttributes } from './user-pool-attr';
import { IUserPoolClient, UserPoolClient, UserPoolClientOptions } from './user-pool-client';
import { UserPoolDomain, UserPoolDomainOptions } from './user-pool-domain';

Expand Down Expand Up @@ -459,7 +459,7 @@ export interface UserPoolProps {
* @deprecated use {@link standardAttributes}
* @default - No required attributes.
*/
readonly requiredAttributes?: StandardAttributes;
readonly requiredAttributes?: RequiredAttributes;

/**
* The set of attributes that are required for every user in the user pool.
Expand Down

0 comments on commit fac3355

Please sign in to comment.