nsmithuk / local-kms

A mock version of AWS' Key Management Service, for local development and testing.
MIT License
198 stars 34 forks source link

support for PutKeyPolicy? #12

Closed shb7628 closed 4 years ago

shb7628 commented 4 years ago

do you anticipate support for PutKeyPolicy?

nsmithuk commented 4 years ago

Hi @shb7628

The short answer is yes; at least to the extent of being able to pass a string to Policy, which can then be returned via GetKeyPolicy.

I haven't put too much thought yet into what extent, if any, I'd go to mocking the validation of the passed string (policy).

Can you tell me what specific user-case you're aiming to mock using that endpoint, and I'll have a think about what would be involved?

bryanlalexander commented 4 years ago

@nsmithuk We are interested in this feature as well, and would be willing to implement it (as you described it, store a string, retrieve a string). Our particular use-case is specifically relating to testing terraform code using localstack.

nsmithuk commented 4 years ago

Hi @bryanlalexander & @shb7628

Support for PutKeyPolicy has been added in v3.3.0. As discussed above, Policy will accept any non-empty string. That same string can then be returned via GetKeyPolicy.

Please give it a test and let me know if it meets your use-cases.

A note on localstack, I believe they're pulling a pre-build binary, thus a fixed version of local-kms. I'll take a look now to see what's involved in always pulling in the latest version (locked to 3.*).

nsmithuk commented 4 years ago

I've added a PR for localstack to ensure they're always pulling in the latest tag of v3: https://github.com/localstack/localstack/pull/1923