Class ApiKeyConfig
java.lang.Object
edu.ntnu.idatt2106_2023_06.backend.config.ApiKeyConfig
The ApiKeyConfig class is responsible for managing the Kassal API key. This class provides a way to access
the API key, but only if the user is authenticated with a JWT token. If the user is not authenticated,
a RuntimeException with message "Not authenticated" will be thrown.
- Author:
- Brage Halvorsen Kvamme, Trym Hamer Gudvangen
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ApiKeyConfig
public ApiKeyConfig()
-
-
Method Details
-
getApiKey
This method returns the Kassal API key if the user is authenticated. If the user is not authenticated, a RuntimeException with message "Not authenticated" will be thrown.- Returns:
- The Kassal API key.
- Throws:
RuntimeException
- If the user is not authenticated.
-