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

[opensearchserverless] SecurityPolicyDetail does not include the policy JSON #5070

Closed
1 of 2 tasks
FlorianSW opened this issue Nov 15, 2023 · 3 comments
Closed
1 of 2 tasks
Assignees
Labels
bug This issue is a bug. investigating This issue is being investigated and/or work is in progress to resolve the issue. p1 This is a high priority issue

Comments

@FlorianSW
Copy link

Describe the feature

The API operation GetSecurityPolicy contains the policy document of the requested policy in the response. The policy is available in the key policy.

However, when using the GetSecurityPolicy method on an opensearchserverless client of the aws-sdk-go, the return type (GetSecurityPolicyOutput -> SecurityPolicyDetail) does not include the policy document.

See the code:

type SecurityPolicyDetail struct {
_ struct{} `type:"structure"`
// The date the policy was created.
CreatedDate *int64 `locationName:"createdDate" type:"long"`
// The description of the security policy.
Description *string `locationName:"description" type:"string"`
// The timestamp of when the policy was last modified.
LastModifiedDate *int64 `locationName:"lastModifiedDate" type:"long"`
// The name of the policy.
Name *string `locationName:"name" min:"3" type:"string"`
// The version of the policy.
PolicyVersion *string `locationName:"policyVersion" min:"20" type:"string"`
// The type of security policy.
Type *string `locationName:"type" type:"string" enum:"SecurityPolicyType"`
}

This makes it currently impossible to inspect the policy document of, e.g., the network or encryption policy applied to an OpenSearch serverless collection.

Use Case

To automate the workflows when working with OpenSearch Serverless collections, I need to be able to inspect several properties of an encryption or network policy applied to a collection. Based on the applied policies our tool using the AWS Go SDK will recommend changes or auto-remediate them. Without knowing the currently applied policies, this is not possible.

Proposed Solution

Add the policy content to the GetSecurityPolicyOutput type.

Other Information

The policy field is added to the v2 version of the SDK already: https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/[email protected]/types#SecurityPolicyDetail

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

SDK version used

v1.47.11

Environment details (Version of Go (go version)? OS name and version, etc.)

go version go1.21.3 darwin/arm64

@FlorianSW FlorianSW added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Nov 15, 2023
@RanVaknin
Copy link
Contributor

Hi @FlorianSW ,

Thanks for opening this issue. This seems like a bug in our model code generation. Specifically there is a discrepancy between the published model and the model the SDK holds for code generation purposes.

We will look into this with priority.
All the best,
Ran~

@RanVaknin RanVaknin assigned RanVaknin and wty-Bryant and unassigned RanVaknin Dec 6, 2023
@RanVaknin RanVaknin added investigating This issue is being investigated and/or work is in progress to resolve the issue. p1 This is a high priority issue bug This issue is a bug. and removed needs-triage This issue or PR still needs to be triaged. feature-request A feature should be added or improved. labels Dec 6, 2023
@RanVaknin RanVaknin assigned RanVaknin and unassigned wty-Bryant Dec 6, 2023
@RanVaknin
Copy link
Contributor

Hi @FlorianSW ,

https://github.com/aws/aws-sdk-go/releases/tag/v1.43.0
This is a known issue where the Go SDK v1 cannot deserialize JSONValue types.

The solution is to upgrade to Go v2.

Thanks,
Ran~

@RanVaknin RanVaknin closed this as not planned Won't fix, can't repro, duplicate, stale Dec 6, 2023
Copy link

github-actions bot commented Dec 6, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. investigating This issue is being investigated and/or work is in progress to resolve the issue. p1 This is a high priority issue
Projects
None yet
Development

No branches or pull requests

3 participants