Skip to content

Commit

Permalink
Support key policy and secret policy OpenAPI.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdk-team committed May 8, 2024
1 parent d3d39c7 commit bea290b
Show file tree
Hide file tree
Showing 16 changed files with 636 additions and 3 deletions.
3 changes: 3 additions & 0 deletions aliyun-java-sdk-kms/ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2024-05-08 Version: 2.16.4
- Support key policy and secret policy OpenAPI.

2023-09-11 Version: 2.16.3
- add Instance, NetworkRule, Policy, ApplicationAccessPoint, ClientKey OpenAPIs

Expand Down
2 changes: 1 addition & 1 deletion aliyun-java-sdk-kms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-kms</artifactId>
<packaging>jar</packaging>
<version>2.16.3</version>
<version>2.16.4</version>
<name>aliyun-java-sdk-kms</name>
<url>http://www.aliyun.com</url>
<description>Aliyun Open API SDK for Java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ public class CreateKeyRequest extends RpcAcsRequest<CreateKeyResponse> {

private String keyUsage;

private String dKMSInstanceId;
private String dKMSInstanceId;

private String policy;
public CreateKeyRequest() {
super("Kms", "2016-01-20", "CreateKey", "kms");
setProtocol(ProtocolType.HTTPS);
Expand Down Expand Up @@ -150,6 +152,17 @@ public void setDKMSInstanceId(String dKMSInstanceId) {
if(dKMSInstanceId != null){
putQueryParameter("DKMSInstanceId", dKMSInstanceId);
}
}

public String getPolicy() {
return this.policy;
}

public void setPolicy(String policy) {
this.policy = policy;
if(policy != null){
putQueryParameter("Policy", policy);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ public class CreateSecretRequest extends RpcAcsRequest<CreateSecretResponse> {

private String secretName;

private String secretDataType;
private String secretDataType;

private String policy;
public CreateSecretRequest() {
super("Kms", "2016-01-20", "CreateSecret", "kms");
setProtocol(ProtocolType.HTTPS);
Expand Down Expand Up @@ -189,6 +191,17 @@ public void setSecretDataType(String secretDataType) {
if(secretDataType != null){
putQueryParameter("SecretDataType", secretDataType);
}
}

public String getPolicy() {
return this.policy;
}

public void setPolicy(String policy) {
this.policy = policy;
if(policy != null){
putQueryParameter("Policy", policy);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.aliyuncs.kms.model.v20160120;

import com.aliyuncs.RpcAcsRequest;
import com.aliyuncs.http.ProtocolType;
import com.aliyuncs.http.MethodType;
import com.aliyuncs.kms.Endpoint;

/**
* @author auto create
* @version
*/
public class GetKeyPolicyRequest extends RpcAcsRequest<GetKeyPolicyResponse> {


private String keyId;

private String policyName;
public GetKeyPolicyRequest() {
super("Kms", "2016-01-20", "GetKeyPolicy", "kms");
setProtocol(ProtocolType.HTTPS);
setMethod(MethodType.POST);
try {
com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap);
com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType);
} catch (Exception e) {}
}

public String getKeyId() {
return this.keyId;
}

public void setKeyId(String keyId) {
this.keyId = keyId;
if(keyId != null){
putQueryParameter("KeyId", keyId);
}
}

public String getPolicyName() {
return this.policyName;
}

public void setPolicyName(String policyName) {
this.policyName = policyName;
if(policyName != null){
putQueryParameter("PolicyName", policyName);
}
}

@Override
public Class<GetKeyPolicyResponse> getResponseClass() {
return GetKeyPolicyResponse.class;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.aliyuncs.kms.model.v20160120;

import com.aliyuncs.AcsResponse;
import com.aliyuncs.kms.transform.v20160120.GetKeyPolicyResponseUnmarshaller;
import com.aliyuncs.transform.UnmarshallerContext;

/**
* @author auto create
* @version
*/
public class GetKeyPolicyResponse extends AcsResponse {

private String requestId;

private String policy;

public String getRequestId() {
return this.requestId;
}

public void setRequestId(String requestId) {
this.requestId = requestId;
}

public String getPolicy() {
return this.policy;
}

public void setPolicy(String policy) {
this.policy = policy;
}

@Override
public GetKeyPolicyResponse getInstance(UnmarshallerContext context) {
return GetKeyPolicyResponseUnmarshaller.unmarshall(this, context);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.aliyuncs.kms.model.v20160120;

import com.aliyuncs.RpcAcsRequest;
import com.aliyuncs.http.ProtocolType;
import com.aliyuncs.http.MethodType;
import com.aliyuncs.kms.Endpoint;

/**
* @author auto create
* @version
*/
public class GetSecretPolicyRequest extends RpcAcsRequest<GetSecretPolicyResponse> {


private String policyName;

private String secretName;
public GetSecretPolicyRequest() {
super("Kms", "2016-01-20", "GetSecretPolicy", "kms");
setProtocol(ProtocolType.HTTPS);
setMethod(MethodType.POST);
try {
com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap);
com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType);
} catch (Exception e) {}
}

public String getPolicyName() {
return this.policyName;
}

public void setPolicyName(String policyName) {
this.policyName = policyName;
if(policyName != null){
putQueryParameter("PolicyName", policyName);
}
}

public String getSecretName() {
return this.secretName;
}

public void setSecretName(String secretName) {
this.secretName = secretName;
if(secretName != null){
putQueryParameter("SecretName", secretName);
}
}

@Override
public Class<GetSecretPolicyResponse> getResponseClass() {
return GetSecretPolicyResponse.class;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.aliyuncs.kms.model.v20160120;

import com.aliyuncs.AcsResponse;
import com.aliyuncs.kms.transform.v20160120.GetSecretPolicyResponseUnmarshaller;
import com.aliyuncs.transform.UnmarshallerContext;

/**
* @author auto create
* @version
*/
public class GetSecretPolicyResponse extends AcsResponse {

private String requestId;

private String policy;

public String getRequestId() {
return this.requestId;
}

public void setRequestId(String requestId) {
this.requestId = requestId;
}

public String getPolicy() {
return this.policy;
}

public void setPolicy(String policy) {
this.policy = policy;
}

@Override
public GetSecretPolicyResponse getInstance(UnmarshallerContext context) {
return GetSecretPolicyResponseUnmarshaller.unmarshall(this, context);
}
}
Loading

0 comments on commit bea290b

Please sign in to comment.