public abstract class SecureStore extends Object
SecureStore is responsible for storing sensitive data like passwords in a secure manner.
It is implementator's responsibility to encrypt and store values.
To deploy new SecureStore one needs to provide a jar file with explicitly one class that
extends SecureStore
and put it in Gerrit server. Then run:
`java -jar gerrit.war SwitchSecureStore -d $gerrit_site --new-secure-store-lib $path_to_new_secure_store.jar`
on stopped Gerrit instance.
Modifier and Type | Class and Description |
---|---|
static class |
SecureStore.EntryKey
Describes
SecureStore entry |
Constructor and Description |
---|
SecureStore() |
Modifier and Type | Method and Description |
---|---|
String |
get(String section,
String subsection,
String name)
Extract decrypted value of stored property from SecureStore or
null when property was
not found. |
String |
getForPlugin(String pluginName,
String section,
String subsection,
String name)
Extract decrypted value of stored plugin config property from SecureStore or
null when
property was not found. |
abstract String[] |
getList(String section,
String subsection,
String name)
Extract list of values from SecureStore and decrypt every value in that list or
null
when property was not found. |
abstract String[] |
getListForPlugin(String pluginName,
String section,
String subsection,
String name)
Extract list of plugin config values from SecureStore and decrypt every value in that list, or
null when property was not found. |
abstract boolean |
isOutdated() |
abstract Iterable<SecureStore.EntryKey> |
list() |
abstract void |
reload()
Reload the values
|
void |
set(String section,
String subsection,
String name,
String value)
Store single value in SecureStore.
|
abstract void |
setList(String section,
String subsection,
String name,
List<String> values)
Store list of values in SecureStore.
|
abstract void |
unset(String section,
String subsection,
String name)
Remove value for given
section , subsection and name from SecureStore. |
public final String get(String section, String subsection, String name)
null
when property was
not found.section
- subsection
- name
- null
if not foundpublic final String getForPlugin(String pluginName, String section, String subsection, String name)
null
when
property was not found.pluginName
- section
- subsection
- name
- null
if not foundpublic abstract String[] getListForPlugin(String pluginName, String section, String subsection, String name)
null
when property was not found.pluginName
- section
- subsection
- name
- null
public abstract String[] getList(String section, String subsection, String name)
null
when property was not found.section
- subsection
- name
- null
public final void set(String section, String subsection, String name, String value)
This method is responsible for encrypting value and storing it.
section
- subsection
- name
- value
- plain text valuepublic abstract void setList(String section, String subsection, String name, List<String> values)
This method is responsible for encrypting all values in the list and storing them.
section
- subsection
- name
- values
- list of plain text valuespublic abstract void unset(String section, String subsection, String name)
section
, subsection
and name
from SecureStore.section
- subsection
- name
- public abstract Iterable<SecureStore.EntryKey> list()
public abstract boolean isOutdated()
true
if currently loaded values are outdatedpublic abstract void reload()