Skip to content
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

Allow AWS secret engine to send empty policy document #23470

Merged
merged 2 commits into from
Oct 3, 2023
Merged
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
3 changes: 3 additions & 0 deletions changelog/23470.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
ui: Fix AWS secret engine to allow empty policy_document field.
```
2 changes: 1 addition & 1 deletion ui/app/models/role-aws.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default Model.extend({
editType: 'json',
helpText:
'A policy is an object in AWS that, when associated with an identity or resource, defines their permissions.',
defaultValue: '{\n}',
// Cannot have a default_value on policy_document because in some cases AWS expects this value to be empty.
}),
fields: computed('credentialType', function () {
const credentialType = this.credentialType;
Expand Down
2 changes: 2 additions & 0 deletions ui/lib/core/addon/helpers/jsonify.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import { helper as buildHelper } from '@ember/component/helper';

export function jsonify([target]) {
// aws secret engine needs to be able to send an empty json value on the field policy_document
if (!target) return;
return JSON.parse(target);
}

Expand Down
Loading