@aws-amplify/graphql-auth-transformer
Advanced tools
Comparing version 0.5.8-geo.0 to 0.5.8-sub-identity-claim.1
@@ -6,10 +6,24 @@ # Change Log | ||
## [0.5.8-geo.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/graphql-auth-transformer@0.5.7...@aws-amplify/graphql-auth-transformer@0.5.8-geo.0) (2022-01-11) | ||
## [0.5.8-sub-identity-claim.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/graphql-auth-transformer@0.5.7...@aws-amplify/graphql-auth-transformer@0.5.8-sub-identity-claim.1) (2022-01-12) | ||
**Note:** Version bump only for package @aws-amplify/graphql-auth-transformer | ||
### Bug Fixes | ||
* add feature flag to use sub as default identity claim ([80516bd](https://github.com/aws-amplify/amplify-cli/commit/80516bd9aa449b5f5243cfe326ba62b84f03d478)) | ||
## [0.5.8-sub-identity-claim.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/graphql-auth-transformer@0.5.7...@aws-amplify/graphql-auth-transformer@0.5.8-sub-identity-claim.0) (2022-01-12) | ||
### Bug Fixes | ||
* add feature flag to use sub as default identity claim ([80516bd](https://github.com/aws-amplify/amplify-cli/commit/80516bd9aa449b5f5243cfe326ba62b84f03d478)) | ||
## [0.5.7](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/graphql-auth-transformer@0.5.5...@aws-amplify/graphql-auth-transformer@0.5.7) (2022-01-10) | ||
@@ -16,0 +30,0 @@ |
@@ -9,2 +9,3 @@ import { TransformerAuthBase } from '@aws-amplify/graphql-transformer-core'; | ||
private configuredAuthProviders; | ||
private useSubForDefaultIdentityClaim; | ||
private roleMap; | ||
@@ -11,0 +12,0 @@ private authModelConfig; |
@@ -41,5 +41,6 @@ "use strict"; | ||
this.before = (context) => { | ||
var _a; | ||
var _a, _b; | ||
this.config.authConfig = (_a = this.config.authConfig) !== null && _a !== void 0 ? _a : context.authConfig; | ||
this.configuredAuthProviders = (0, utils_1.getConfiguredAuthProviders)(this.config); | ||
this.useSubForDefaultIdentityClaim = (_b = context.featureFlags) === null || _b === void 0 ? void 0 : _b.getBoolean('useSubForDefaultIdentityClaim'); | ||
}; | ||
@@ -533,3 +534,4 @@ this.object = (def, directive, context) => { | ||
const ownerField = rule.ownerField || utils_1.DEFAULT_OWNER_FIELD; | ||
const ownerClaim = rule.identityClaim || utils_1.DEFAULT_IDENTITY_CLAIM; | ||
const defaultIdentityClaim = this.useSubForDefaultIdentityClaim && 'sub'; | ||
const ownerClaim = rule.identityClaim || defaultIdentityClaim || utils_1.DEFAULT_IDENTITY_CLAIM; | ||
roleName = `${rule.provider}:owner:${ownerField}:${ownerClaim}`; | ||
@@ -536,0 +538,0 @@ roleDefinition = { |
@@ -36,3 +36,3 @@ "use strict"; | ||
if (ownerClaim === 'username') { | ||
return (0, exports.getIdentityClaimExp)((0, graphql_mapping_template_1.str)(ownerClaim), (0, exports.getIdentityClaimExp)((0, graphql_mapping_template_1.str)(utils_1.DEFAULT_COGNITO_IDENTITY_CLAIM), (0, graphql_mapping_template_1.str)(graphql_transformer_common_1.NONE_VALUE))); | ||
return (0, exports.getIdentityClaimExp)((0, graphql_mapping_template_1.str)(ownerClaim), (0, exports.getIdentityClaimExp)((0, graphql_mapping_template_1.str)(utils_1.COGNITO_USERNAME_IDENTITY_CLAIM), (0, graphql_mapping_template_1.str)(graphql_transformer_common_1.NONE_VALUE))); | ||
} | ||
@@ -39,0 +39,0 @@ return (0, exports.getIdentityClaimExp)((0, graphql_mapping_template_1.str)(ownerClaim), (0, graphql_mapping_template_1.str)(graphql_transformer_common_1.NONE_VALUE)); |
import { AuthProvider, ModelOperation } from './definitions'; | ||
export declare const DEFAULT_OWNER_FIELD = "owner"; | ||
export declare const DEFAULT_GROUPS_FIELD = "groups"; | ||
export declare const COGNITO_USERNAME_IDENTITY_CLAIM = "cognito:username"; | ||
export declare const DEFAULT_IDENTITY_CLAIM = "username"; | ||
export declare const DEFAULT_COGNITO_IDENTITY_CLAIM = "cognito:username"; | ||
export declare const DEFAULT_GROUP_CLAIM = "cognito:groups"; | ||
@@ -7,0 +7,0 @@ export declare const ON_CREATE_FIELD = "onCreate"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.SEARCHABLE_AGGREGATE_TYPES = exports.RELATIONAL_DIRECTIVES = exports.NONE_DS = exports.DENIED_FIELDS = exports.NULL_ALLOWED_FIELDS = exports.ALLOWED_FIELDS = exports.IS_AUTHORIZED_FLAG = exports.API_KEY_AUTH_TYPE = exports.LAMBDA_AUTH_TYPE = exports.IAM_AUTH_TYPE = exports.OIDC_AUTH_TYPE = exports.COGNITO_AUTH_TYPE = exports.AUTH_PROVIDER_DIRECTIVE_MAP = exports.MODEL_OPERATIONS = exports.AUTH_NON_MODEL_TYPES = exports.ON_DELETE_FIELD = exports.ON_UPDATE_FIELD = exports.ON_CREATE_FIELD = exports.DEFAULT_GROUP_CLAIM = exports.DEFAULT_COGNITO_IDENTITY_CLAIM = exports.DEFAULT_IDENTITY_CLAIM = exports.DEFAULT_GROUPS_FIELD = exports.DEFAULT_OWNER_FIELD = void 0; | ||
exports.SEARCHABLE_AGGREGATE_TYPES = exports.RELATIONAL_DIRECTIVES = exports.NONE_DS = exports.DENIED_FIELDS = exports.NULL_ALLOWED_FIELDS = exports.ALLOWED_FIELDS = exports.IS_AUTHORIZED_FLAG = exports.API_KEY_AUTH_TYPE = exports.LAMBDA_AUTH_TYPE = exports.IAM_AUTH_TYPE = exports.OIDC_AUTH_TYPE = exports.COGNITO_AUTH_TYPE = exports.AUTH_PROVIDER_DIRECTIVE_MAP = exports.MODEL_OPERATIONS = exports.AUTH_NON_MODEL_TYPES = exports.ON_DELETE_FIELD = exports.ON_UPDATE_FIELD = exports.ON_CREATE_FIELD = exports.DEFAULT_GROUP_CLAIM = exports.DEFAULT_IDENTITY_CLAIM = exports.COGNITO_USERNAME_IDENTITY_CLAIM = exports.DEFAULT_GROUPS_FIELD = exports.DEFAULT_OWNER_FIELD = void 0; | ||
exports.DEFAULT_OWNER_FIELD = 'owner'; | ||
exports.DEFAULT_GROUPS_FIELD = 'groups'; | ||
exports.COGNITO_USERNAME_IDENTITY_CLAIM = 'cognito:username'; | ||
exports.DEFAULT_IDENTITY_CLAIM = 'username'; | ||
exports.DEFAULT_COGNITO_IDENTITY_CLAIM = 'cognito:username'; | ||
exports.DEFAULT_GROUP_CLAIM = 'cognito:groups'; | ||
@@ -9,0 +9,0 @@ exports.ON_CREATE_FIELD = 'onCreate'; |
{ | ||
"name": "@aws-amplify/graphql-auth-transformer", | ||
"version": "0.5.8-geo.0", | ||
"version": "0.5.8-sub-identity-claim.1", | ||
"description": "Amplify GraphQL @auth Transformer", | ||
@@ -30,5 +30,5 @@ "repository": { | ||
"dependencies": { | ||
"@aws-amplify/graphql-model-transformer": "0.10.6-geo.0", | ||
"@aws-amplify/graphql-transformer-core": "0.15.5-geo.0", | ||
"@aws-amplify/graphql-transformer-interfaces": "1.12.6-geo.0", | ||
"@aws-amplify/graphql-model-transformer": "0.10.5", | ||
"@aws-amplify/graphql-transformer-core": "0.15.4", | ||
"@aws-amplify/graphql-transformer-interfaces": "1.12.5", | ||
"@aws-cdk/aws-appsync": "~1.124.0", | ||
@@ -40,9 +40,9 @@ "@aws-cdk/aws-dynamodb": "~1.124.0", | ||
"graphql": "^14.5.8", | ||
"graphql-mapping-template": "4.20.4-geo.0", | ||
"graphql-transformer-common": "4.22.5-geo.0", | ||
"graphql-mapping-template": "4.20.3", | ||
"graphql-transformer-common": "4.22.4", | ||
"lodash": "^4.17.21" | ||
}, | ||
"devDependencies": { | ||
"@aws-amplify/graphql-index-transformer": "0.8.6-geo.0", | ||
"@aws-amplify/graphql-searchable-transformer": "0.10.6-geo.0", | ||
"@aws-amplify/graphql-index-transformer": "0.8.5", | ||
"@aws-amplify/graphql-searchable-transformer": "0.10.5", | ||
"@aws-cdk/assert": "~1.124.0", | ||
@@ -68,3 +68,3 @@ "@types/fs-extra": "^8.0.1", | ||
}, | ||
"gitHead": "e57f636717f1fd36514aec6e02e6521aa42a7b74" | ||
"gitHead": "74134237d28d9247dadb0c8ec14e919609c8a34f" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
401881
3045
+ Added@aws-amplify/graphql-model-transformer@0.10.5(transitive)
+ Added@aws-amplify/graphql-transformer-core@0.15.4(transitive)
+ Added@aws-amplify/graphql-transformer-interfaces@1.12.5(transitive)
+ Addedamplify-prompts@1.6.2(transitive)
+ Addedgraphql-mapping-template@4.20.3(transitive)
+ Addedgraphql-transformer-common@4.22.4(transitive)
- Removed@aws-amplify/graphql-model-transformer@0.10.6-geo.0(transitive)
- Removed@aws-amplify/graphql-transformer-core@0.15.5-geo.0(transitive)
- Removed@aws-amplify/graphql-transformer-interfaces@1.12.6-geo.0(transitive)
- Removedamplify-prompts@1.6.3-geo.0(transitive)
- Removedgraphql-mapping-template@4.20.4-geo.0(transitive)
- Removedgraphql-transformer-common@4.22.5-geo.0(transitive)