Class ApiKeyFileStore
java.lang.Object
com.predic8.membrane.core.interceptor.apikey.stores.ApiKeyFileStore
- All Implemented Interfaces:
ApiKeyStore
- Description
- Loads api keys from a file. File has to be one key per line, blank lines for formatting are allowed. Optionally, a comma separated list of scopes after the key and a colon in between the two. Hash symbol can be used for comments at the end of each line, including empty lines.
- Example
- See: https://github.com/membrane/api-gateway/blob/master/distribution/examples/security/api-key/simple/demo-keys.txt
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ApiKeyFileStore
public ApiKeyFileStore()
-
-
Method Details
-
init
- Specified by:
initin interfaceApiKeyStore
-
readKeyData
public static Map<String,Optional<List<String>>> readKeyData(Stream<String> lines) throws IOException - Throws:
IOException
-
getScopes
- Specified by:
getScopesin interfaceApiKeyStore- Throws:
UnauthorizedApiKeyException
-
setLocation
- Description
- Path/URL to the api key file.
-
getLocation
-