forked from greenplum-db/pxf-archive
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from arenadata/feature/ADBDEV-3209
ADBDEV-3209: Add possibility to decrypt an encrypted password
- Loading branch information
Showing
12 changed files
with
248 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...i/src/main/java/org/greenplum/pxf/api/configuration/PxfJksTextEncryptorConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.greenplum.pxf.api.configuration; | ||
|
||
import io.arenadata.security.encryption.client.configuration.JksTextEncryptorConfiguration; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
@ConditionalOnProperty({"pxf.ssl.jks-store.path", "pxf.ssl.jks-store.password", "pxf.ssl.salt.key"}) | ||
public class PxfJksTextEncryptorConfiguration extends JksTextEncryptorConfiguration { | ||
private final String path; | ||
private final String password; | ||
private final String key; | ||
|
||
public PxfJksTextEncryptorConfiguration(@Value("${pxf.ssl.jks-store.path}") String path, | ||
@Value("${pxf.ssl.jks-store.password}") String password, | ||
@Value("${pxf.ssl.salt.key}") String key) { | ||
this.path = path; | ||
this.password = password; | ||
this.key = key; | ||
} | ||
|
||
@Override | ||
protected String jksStorePath() { | ||
return path; | ||
} | ||
|
||
@Override | ||
protected char[] jksStorePassword() { | ||
return password.toCharArray(); | ||
} | ||
|
||
@Override | ||
protected String secretKeyAlias() { | ||
return key; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.