11package cloud .stackit .sdk .core .auth ;
22
33import cloud .stackit .sdk .core .KeyFlowAuthenticator ;
4- import cloud .stackit .sdk .core .config .Configuration ;
4+ import cloud .stackit .sdk .core .config .CoreConfiguration ;
55import cloud .stackit .sdk .core .config .EnvironmentVariables ;
66import cloud .stackit .sdk .core .KeyFlowInterceptor ;
77import cloud .stackit .sdk .core .model .ServiceAccountKey ;
@@ -37,7 +37,7 @@ public class SetupAuth {
3737 * @throws InvalidKeySpecException when the private key can not be parsed
3838 */
3939 public SetupAuth () throws IOException , InvalidKeySpecException , CredentialNotFoundException {
40- this (new Configuration .Builder ().build ());
40+ this (new CoreConfiguration .Builder ().build ());
4141 }
4242
4343 /**
@@ -47,9 +47,9 @@ public SetupAuth() throws IOException, InvalidKeySpecException, CredentialNotFou
4747 * @throws CredentialNotFoundException when no configuration is set or can be found
4848 * @throws InvalidKeySpecException when the private key can not be parsed
4949 */
50- public SetupAuth (Configuration cfg ) throws IOException , CredentialNotFoundException , InvalidKeySpecException {
50+ public SetupAuth (CoreConfiguration cfg ) throws IOException , CredentialNotFoundException , InvalidKeySpecException {
5151 if (cfg == null ) {
52- cfg = new Configuration .Builder ().build ();
52+ cfg = new CoreConfiguration .Builder ().build ();
5353 }
5454
5555 ServiceAccountKey saKey = setupKeyFlow (cfg );
@@ -93,7 +93,7 @@ public Interceptor getAuthHandler() {
9393 * @throws CredentialNotFoundException throws error when no service account key or private key can be found
9494 * @throws IOException throws an error if a file can not be found
9595 */
96- private ServiceAccountKey setupKeyFlow (Configuration cfg ) throws CredentialNotFoundException , IOException {
96+ private ServiceAccountKey setupKeyFlow (CoreConfiguration cfg ) throws CredentialNotFoundException , IOException {
9797 // Explicit config in code
9898 if (cfg .getServiceAccountKey () != null && !cfg .getServiceAccountKey ().trim ().isEmpty ()) {
9999 ServiceAccountKey saKey = ServiceAccountKey .loadFromJson (cfg .getServiceAccountKey ());
@@ -135,7 +135,7 @@ private ServiceAccountKey setupKeyFlow(Configuration cfg) throws CredentialNotFo
135135 }
136136 }
137137
138- private void loadPrivateKey (Configuration cfg , ServiceAccountKey saKey ) throws CredentialNotFoundException {
138+ private void loadPrivateKey (CoreConfiguration cfg , ServiceAccountKey saKey ) throws CredentialNotFoundException {
139139 if (!saKey .getCredentials ().isPrivateKeySet ()) {
140140 try {
141141 String privateKey = getPrivateKey (cfg );
@@ -178,7 +178,7 @@ private void loadPrivateKey(Configuration cfg, ServiceAccountKey saKey) throws C
178178 * @throws CredentialNotFoundException throws if no private key could be found
179179 * @throws IOException throws if the provided path can not be found or the file within the pathKey can not be found
180180 */
181- private String getPrivateKey (Configuration cfg ) throws CredentialNotFoundException , IOException {
181+ private String getPrivateKey (CoreConfiguration cfg ) throws CredentialNotFoundException , IOException {
182182 // Explicit code config
183183 // Set private key
184184 if (cfg .getPrivateKey () != null && !cfg .getPrivateKey ().trim ().isEmpty ()) {
0 commit comments