Skip to content

Commit

Permalink
feat: rename iam -> identityPool in data-schema (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
iartemiev authored Apr 26, 2024
1 parent 0a53714 commit b3fffcf
Show file tree
Hide file tree
Showing 15 changed files with 71 additions and 60 deletions.
6 changes: 6 additions & 0 deletions .changeset/brown-kiwis-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@aws-amplify/data-schema-types": patch
"@aws-amplify/data-schema": patch
---

feat: rename iam -> identityPool
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions packages/benches/p50/operations/p50-prod-CRUDL.bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ bench('prod p50 CRUDL', async () => {
ipAddress: a.ipAddress(),
})
.authorization((allow) => [
allow.authenticated('iam').to(['read']),
allow.authenticated('identityPool').to(['read']),
allow.owner(),
]),
// Model #23:
Expand Down Expand Up @@ -516,7 +516,7 @@ bench('prod p50 CRUDL', async () => {
ipAddress: a.ipAddress(),
})
.authorization((allow) => [
allow.authenticated('iam').to(['read']),
allow.authenticated('identityPool').to(['read']),
allow.owner(),
]),
// Model #24:
Expand Down Expand Up @@ -551,7 +551,7 @@ bench('prod p50 CRUDL', async () => {
ipAddress: a.ipAddress(),
})
.authorization((allow) => [
allow.authenticated('iam').to(['read']),
allow.authenticated('identityPool').to(['read']),
allow.owner(),
]),
// Model #25:
Expand Down Expand Up @@ -586,7 +586,7 @@ bench('prod p50 CRUDL', async () => {
ipAddress: a.ipAddress(),
})
.authorization((allow) => [
allow.authenticated('iam').to(['read']),
allow.authenticated('identityPool').to(['read']),
allow.owner(),
]),
// [Global authorization rule]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ bench('prod p50 CRUDL', async () => {
ipAddress: a.ipAddress(),
})
.authorization((allow) => [
allow.authenticated('iam').to(['read']),
allow.authenticated('identityPool').to(['read']),
allow.owner(),
]),
// Model #23:
Expand Down Expand Up @@ -519,7 +519,7 @@ bench('prod p50 CRUDL', async () => {
ipAddress: a.ipAddress(),
})
.authorization((allow) => [
allow.authenticated('iam').to(['read']),
allow.authenticated('identityPool').to(['read']),
allow.owner(),
]),
// Model #24:
Expand Down Expand Up @@ -554,7 +554,7 @@ bench('prod p50 CRUDL', async () => {
ipAddress: a.ipAddress(),
})
.authorization((allow) => [
allow.authenticated('iam').to(['read']),
allow.authenticated('identityPool').to(['read']),
allow.owner(),
]),
// Model #25:
Expand Down Expand Up @@ -589,7 +589,7 @@ bench('prod p50 CRUDL', async () => {
ipAddress: a.ipAddress(),
})
.authorization((allow) => [
allow.authenticated('iam').to(['read']),
allow.authenticated('identityPool').to(['read']),
allow.owner(),
]),
// [Global authorization rule]
Expand Down
24 changes: 12 additions & 12 deletions packages/benches/p50/p50-prod.bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ bench('prod p50', () => {
ipAddress: a.ipAddress(),
})
.authorization((allow) => [
allow.authenticated('iam').to(['read']),
allow.authenticated('identityPool').to(['read']),
allow.owner(),
]),
// Model #23:
Expand Down Expand Up @@ -521,7 +521,7 @@ bench('prod p50', () => {
ipAddress: a.ipAddress(),
})
.authorization((allow) => [
allow.authenticated('iam').to(['read']),
allow.authenticated('identityPool').to(['read']),
allow.owner(),
]),
// Model #24:
Expand Down Expand Up @@ -556,7 +556,7 @@ bench('prod p50', () => {
ipAddress: a.ipAddress(),
})
.authorization((allow) => [
allow.authenticated('iam').to(['read']),
allow.authenticated('identityPool').to(['read']),
allow.owner(),
]),
// Model #25:
Expand Down Expand Up @@ -591,7 +591,7 @@ bench('prod p50', () => {
ipAddress: a.ipAddress(),
})
.authorization((allow) => [
allow.authenticated('iam').to(['read']),
allow.authenticated('identityPool').to(['read']),
allow.owner(),
]),
// [Global authorization rule]
Expand Down Expand Up @@ -1075,7 +1075,7 @@ bench('prod p50 w/ client types', () => {
ipAddress: a.ipAddress(),
})
.authorization((allow) => [
allow.authenticated('iam').to(['read']),
allow.authenticated('identityPool').to(['read']),
allow.owner(),
]),
// Model #23:
Expand Down Expand Up @@ -1110,7 +1110,7 @@ bench('prod p50 w/ client types', () => {
ipAddress: a.ipAddress(),
})
.authorization((allow) => [
allow.authenticated('iam').to(['read']),
allow.authenticated('identityPool').to(['read']),
allow.owner(),
]),
// Model #24:
Expand Down Expand Up @@ -1145,7 +1145,7 @@ bench('prod p50 w/ client types', () => {
ipAddress: a.ipAddress(),
})
.authorization((allow) => [
allow.authenticated('iam').to(['read']),
allow.authenticated('identityPool').to(['read']),
allow.owner(),
]),
// Model #25:
Expand Down Expand Up @@ -1180,7 +1180,7 @@ bench('prod p50 w/ client types', () => {
ipAddress: a.ipAddress(),
})
.authorization((allow) => [
allow.authenticated('iam').to(['read']),
allow.authenticated('identityPool').to(['read']),
allow.owner(),
]),
// [Global authorization rule]
Expand Down Expand Up @@ -1667,7 +1667,7 @@ bench('prod p50 combined w/ client types', () => {
ipAddress: a.ipAddress(),
})
.authorization((allow) => [
allow.authenticated('iam').to(['read']),
allow.authenticated('identityPool').to(['read']),
allow.owner(),
]),
// Model #23:
Expand Down Expand Up @@ -1702,7 +1702,7 @@ bench('prod p50 combined w/ client types', () => {
ipAddress: a.ipAddress(),
})
.authorization((allow) => [
allow.authenticated('iam').to(['read']),
allow.authenticated('identityPool').to(['read']),
allow.owner(),
]),
// Model #24:
Expand Down Expand Up @@ -1737,7 +1737,7 @@ bench('prod p50 combined w/ client types', () => {
ipAddress: a.ipAddress(),
})
.authorization((allow) => [
allow.authenticated('iam').to(['read']),
allow.authenticated('identityPool').to(['read']),
allow.owner(),
]),
// Model #25:
Expand Down Expand Up @@ -1772,7 +1772,7 @@ bench('prod p50 combined w/ client types', () => {
ipAddress: a.ipAddress(),
})
.authorization((allow) => [
allow.authenticated('iam').to(['read']),
allow.authenticated('identityPool').to(['read']),
allow.owner(),
]),
// [Global authorization rule]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
**Signature:**

```typescript
export type AuthMode = 'apiKey' | 'iam' | 'oidc' | 'userPool' | 'lambda' | 'none';
export type AuthMode = 'apiKey' | 'iam' | 'identityPool' | 'oidc' | 'userPool' | 'lambda' | 'none';
```
1 change: 1 addition & 0 deletions packages/data-schema-types/src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ export type LazyLoader<Model, IsArray extends boolean> = (
export type AuthMode =
| 'apiKey'
| 'iam'
| 'identityPool'
| 'oidc'
| 'userPool'
| 'lambda'
Expand Down
24 changes: 12 additions & 12 deletions packages/data-schema/__tests__/__snapshots__/ModelType.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -176,84 +176,84 @@ exports[`model auth rules can define private auth with no provider 1`] = `
}"
`;

exports[`model auth rules can define private with with provider iam 1`] = `
exports[`model auth rules can define private with with provider identityPool 1`] = `
"type widget @model @auth(rules: [{allow: private, provider: iam}])
{
title: String!
}"
`;

exports[`model auth rules can define private with with provider iam for operations create 1`] = `
exports[`model auth rules can define private with with provider identityPool for operations create 1`] = `
"type widget @model @auth(rules: [{allow: private, provider: iam, operations: [create]}])
{
title: String!
}"
`;

exports[`model auth rules can define private with with provider iam for operations create,read,listen 1`] = `
exports[`model auth rules can define private with with provider identityPool for operations create,read,listen 1`] = `
"type widget @model @auth(rules: [{allow: private, provider: iam, operations: [create, read, listen]}])
{
title: String!
}"
`;

exports[`model auth rules can define private with with provider iam for operations create,read,update,delete 1`] = `
exports[`model auth rules can define private with with provider identityPool for operations create,read,update,delete 1`] = `
"type widget @model @auth(rules: [{allow: private, provider: iam, operations: [create, read, update, delete]}])
{
title: String!
}"
`;

exports[`model auth rules can define private with with provider iam for operations delete 1`] = `
exports[`model auth rules can define private with with provider identityPool for operations delete 1`] = `
"type widget @model @auth(rules: [{allow: private, provider: iam, operations: [delete]}])
{
title: String!
}"
`;

exports[`model auth rules can define private with with provider iam for operations get 1`] = `
exports[`model auth rules can define private with with provider identityPool for operations get 1`] = `
"type widget @model @auth(rules: [{allow: private, provider: iam, operations: [get]}])
{
title: String!
}"
`;

exports[`model auth rules can define private with with provider iam for operations list 1`] = `
exports[`model auth rules can define private with with provider identityPool for operations list 1`] = `
"type widget @model @auth(rules: [{allow: private, provider: iam, operations: [list]}])
{
title: String!
}"
`;

exports[`model auth rules can define private with with provider iam for operations listen 1`] = `
exports[`model auth rules can define private with with provider identityPool for operations listen 1`] = `
"type widget @model @auth(rules: [{allow: private, provider: iam, operations: [listen]}])
{
title: String!
}"
`;

exports[`model auth rules can define private with with provider iam for operations read 1`] = `
exports[`model auth rules can define private with with provider identityPool for operations read 1`] = `
"type widget @model @auth(rules: [{allow: private, provider: iam, operations: [read]}])
{
title: String!
}"
`;

exports[`model auth rules can define private with with provider iam for operations search 1`] = `
exports[`model auth rules can define private with with provider identityPool for operations search 1`] = `
"type widget @model @auth(rules: [{allow: private, provider: iam, operations: [search]}])
{
title: String!
}"
`;

exports[`model auth rules can define private with with provider iam for operations sync 1`] = `
exports[`model auth rules can define private with with provider identityPool for operations sync 1`] = `
"type widget @model @auth(rules: [{allow: private, provider: iam, operations: [sync]}])
{
title: String!
}"
`;

exports[`model auth rules can define private with with provider iam for operations update 1`] = `
exports[`model auth rules can define private with with provider identityPool for operations update 1`] = `
"type widget @model @auth(rules: [{allow: private, provider: iam, operations: [update]}])
{
title: String!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('generateEnumsProperty()', () => {
it('returns an empty object when there is no valid `modelIntrospection`', () => {
const mockAPIGraphQLConfig: GraphQLProviderConfig['GraphQL'] = {
endpoint: 'endpoint',
defaultAuthMode: 'iam',
defaultAuthMode: 'identityPool',
} as any;
const result = generateEnumsProperty(mockAPIGraphQLConfig);

Expand All @@ -15,7 +15,7 @@ describe('generateEnumsProperty()', () => {
it('returns expected `enums` object', () => {
const mockAPIGraphQLConfig: GraphQLProviderConfig['GraphQL'] = {
endpoint: 'endpoint',
defaultAuthMode: 'iam',
defaultAuthMode: 'identityPool',
modelIntrospection: {
version: 1,
models: {},
Expand Down
Loading

0 comments on commit b3fffcf

Please sign in to comment.