-
Notifications
You must be signed in to change notification settings - Fork 4.3k
fix(kms): Alias
reference incorrectly resolves to underlying Key
#35545
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
Conversation
Because `IAlias` extends `IKey`, `IAlias` inherits the new `keyRef: KeyReference`. It was originally implemented by referencing the underlying key, but that's wrong: it should reference the alias itself, but using the field names it shares with `IKey`. In fact, we should have introduced a new interface like `IKeyLike` to do this job, but instead we overloaded `IKey` to behave like a hypothetical `IKeyLike`, and `IKeyRef` now inherits this double duty. Therefore, we now make the `IKeyRef` implementation of `Alias` behave like a `IKeyLikeRef`, and satisfy the contract using its own fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This review is outdated)
Alias
reference incorrectly resolves to underlying Key
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
The `IFunctionRef` implementation of `LatestVersion` returns the underlying function ARN, instead of the version's ARN. This is a similar situation and fix to #35545.
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Comments on closed issues and PRs are hard for our team to see. |
Because
IAlias
extendsIKey
,IAlias
inherits the newkeyRef: KeyReference
.It was originally implemented by referencing the underlying key, but that's wrong: it should reference the alias itself, but using the field names it shares with
IKey
.In fact, we should have introduced a new interface like
IKeyLike
to do this job, but instead we overloadedIKey
to behave like a hypotheticalIKeyLike
, andIKeyRef
now inherits this double duty.Therefore, we now make the
IKeyRef
implementation ofAlias
behave like aIKeyLikeRef
, and satisfy the contract using its own fields.Closes #35543
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license