Class SecureStore
java.lang.Object
com.google.gerrit.server.securestore.SecureStore
- Direct Known Subclasses:
DefaultSecureStore
Abstract class for providing new SecureStore implementation for Gerrit.
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.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal String
Extract decrypted value of stored property from SecureStore ornull
when property was not found.final String
getForPlugin
(String pluginName, String section, String subsection, String name) Extract decrypted value of stored plugin config property from SecureStore ornull
when property was not found.abstract String[]
Extract list of values from SecureStore and decrypt every value in that list ornull
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, ornull
when property was not found.abstract boolean
Returnstrue
if currently loaded values are outdatedabstract Iterable<SecureStore.EntryKey>
list()
Returns list of stored entries.abstract void
reload()
Reload the valuesfinal void
Store single value in SecureStore.abstract void
Store list of values in SecureStore.abstract void
Remove value for givensection
,subsection
andname
from SecureStore.
-
Constructor Details
-
SecureStore
public SecureStore()
-
-
Method Details
-
get
Extract decrypted value of stored property from SecureStore ornull
when property was not found.- Returns:
- decrypted String value or
null
if not found
-
getForPlugin
Extract decrypted value of stored plugin config property from SecureStore ornull
when property was not found.- Returns:
- decrypted String value or
null
if not found
-
getListForPlugin
public 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, ornull
when property was not found.- Returns:
- decrypted list of string values or
null
-
getList
Extract list of values from SecureStore and decrypt every value in that list ornull
when property was not found.- Returns:
- decrypted list of string values or
null
-
set
Store single value in SecureStore.This method is responsible for encrypting value and storing it.
- Parameters:
value
- plain text value
-
setList
Store list of values in SecureStore.This method is responsible for encrypting all values in the list and storing them.
- Parameters:
values
- list of plain text values
-
unset
Remove value for givensection
,subsection
andname
from SecureStore. -
list
Returns list of stored entries. -
isOutdated
public abstract boolean isOutdated()Returnstrue
if currently loaded values are outdated -
reload
public abstract void reload()Reload the values
-