emiliosetiadarma commented on a change in pull request #5202: URL: https://github.com/apache/nifi/pull/5202#discussion_r674364119
########## File path: nifi-commons/nifi-sensitive-property-provider/src/test/java/org/apache/nifi/properties/AWSSensitivePropertyProviderIT.java ########## @@ -0,0 +1,133 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 org.apache.nifi.properties; + +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; +import org.mockito.internal.util.io.IOUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Properties; + +/** + * To run this test, make sure to first configure sensitive credential information as in the following link + * https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html + * + * If you don't have a key then run: + * aws kms create-key + * + * Take note of the key id or arn. + * + * Then, set the system property -Daws.kms.key.id to the either key id value or arn value + * + * The following settings are optional. If you have a default AWS configuration and credentials in ~/.aws then + * it will take that. Otherwise you can set all of the following: + * set the system property -Daws.access.key.id to the access key id + * set the system property -Daws.secret.key.id to the secret key id + * set the system property -Daws.region to the region + * + * After you are satisfied with the test, and you don't need the key, you may schedule key deletion with: + * aws kms schedule-key-deletion --key-id "key id" --pending-window-in-days "number of days" + * + */ + +public class AWSSensitivePropertyProviderIT { + private static final String SAMPLE_PLAINTEXT = "AWSSensitivePropertyProviderIT SAMPLE-PLAINTEXT"; + private static final String ACCESS_KEY_PROPS_NAME = "aws.access.key.id"; + private static final String SECRET_KEY_PROPS_NAME = "aws.secret.key.id"; Review comment: Will make the changes -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
