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

Don't Propagate Attributes on Disabled Instance Policy #125

Merged
merged 1 commit into from
May 13, 2024

Conversation

william8siew
Copy link
Contributor

@william8siew william8siew commented May 13, 2024

The Key Protect instance policy API does not allow attributes to be specified when disabling KeyCreateImportAccess and AllowedIP policies. Currently, there is no way to omit attributes when calling SetInstancePolicies(), thus any call to disable these policies fails with error INVALID_FIELD_ERR: The field attributes must be: provided only if policy is being enabled.

This PR makes it so attributes are ignored when disabling KeyCreateImportAccess and AllowedIP policies (no attribute object is sent during the disable per API's input requirement).

Related to IBM-Cloud/terraform-provider-ibm#5342

@stephaniegalang stephaniegalang changed the title tf bugfix: instpol attrib enabled only Don't Propagate Attributes on Disabled Instance Policy May 13, 2024
Signed-off-by: stephaniegalang <stephaniegalang@ibm.com>
Copy link
Collaborator

@stephaniegalang stephaniegalang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested via Terraform provider, disablement no longer returns INVALID_FIELD_ERR: The field attributes must be: provided only if policy is being enabled error

@stephaniegalang stephaniegalang merged commit 9d7123f into IBM:master May 13, 2024
2 checks passed
MDarmawan pushed a commit to MDarmawan/keyprotect-go-client that referenced this pull request May 30, 2024
Signed-off-by: stephaniegalang <stephaniegalang@ibm.com>
Co-authored-by: stephaniegalang <stephaniegalang@ibm.com>
Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>
stephaniegalang pushed a commit that referenced this pull request Jun 3, 2024
* rename keyring path for conflicts

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* initial implementation of adapters and certs

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* add kmip objects, fix some stuff

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* fix structs

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* unit tests, and some fixes

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* remove import cycle

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* redo mocks

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* add mockauth

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* fix mobk paths

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* fix marshalling

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* fix delete tests

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* remove old kmip profile data

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* address PR comments

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* finish address comments

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* hardcode mock responses, refactor kmip collection metadata

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* fix tests?

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* fix typo

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* add object filter, overhaul list options

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* enhance tests

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* unexport path variables, add comments

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* sdk fixes

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* remove crk from adapter list

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* add crkID filter

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* feat(build): Update travis distribution in CI file (#123)

* change travis dist

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* add npm install check to travis

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* real fix

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* change python version

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* remove pyenv, let it use default python version of 3.10

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

---------

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* add info to contributing about the semantic release (#124)

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* instpol attrib enabled only (#125)

Signed-off-by: stephaniegalang <stephaniegalang@ibm.com>
Co-authored-by: stephaniegalang <stephaniegalang@ibm.com>
Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* Allow instance policy attributes to be optionally specified (#126)

* allow attributes to be specified optionally

Signed-off-by: stephaniegalang <stephaniegalang@ibm.com>

* propogate attributes, ignoring disable

Signed-off-by: stephaniegalang <stephaniegalang@ibm.com>

---------

Signed-off-by: stephaniegalang <stephaniegalang@ibm.com>
Co-authored-by: stephaniegalang <stephaniegalang@ibm.com>
Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

* fix missed merge artifacts

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>

---------

Signed-off-by: Michael Darmawan <michael.darmawan@ibm.com>
Signed-off-by: stephaniegalang <stephaniegalang@ibm.com>
Co-authored-by: William Siew <38149204+william8siew@users.noreply.github.com>
Co-authored-by: stephaniegalang <stephaniegalang@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants