-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Collecting all subclasses of ClientCredential in security-core.
- Added factory for autoconfiguration of ClientCredential beans. - Added default beans for "test" profile.
- Loading branch information
Showing
18 changed files
with
205 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
...tive-security/src/main/java/no/nav/testnav/libs/reactivesecurity/domain/AccessScopes.java
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
.../main/java/no/nav/testnav/libs/reactivesecurity/domain/AzureNavProxyClientCredential.java
This file was deleted.
Oops, something went wrong.
41 changes: 0 additions & 41 deletions
41
...n/java/no/nav/testnav/libs/reactivesecurity/domain/AzureTrygdeetatenClientCredential.java
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
...eactive-security/src/main/java/no/nav/testnav/libs/reactivesecurity/domain/Scopeable.java
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...in/java/no/nav/testnav/libs/reactivesecurity/exchange/azuread/NavAzureAdTokenService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 2 additions & 9 deletions
11
...c/main/java/no/nav/testnav/libs/securitycore/domain/azuread/AzureNavClientCredential.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,9 @@ | ||
package no.nav.testnav.libs.securitycore.domain.azuread; | ||
|
||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class AzureNavClientCredential extends ClientCredential { | ||
|
||
public AzureNavClientCredential( | ||
@Value("${AZURE_APP_CLIENT_ID:#{null}}") String clientId, | ||
@Value("${AZURE_APP_CLIENT_SECRET:#{null}}") String clientSecret | ||
) { | ||
public AzureNavClientCredential(String clientId, String clientSecret) { | ||
super(clientId, clientSecret); | ||
} | ||
|
||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...n/java/no/nav/testnav/libs/securitycore/domain/azuread/AzureNavProxyClientCredential.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package no.nav.testnav.libs.securitycore.domain.azuread; | ||
|
||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@EqualsAndHashCode(callSuper = false) | ||
public class AzureNavProxyClientCredential extends ClientCredential { | ||
|
||
private final String tokenEndpoint; | ||
|
||
public AzureNavProxyClientCredential(String tokenEndpoint, String clientId, String clientSecret) { | ||
super(clientId, clientSecret); | ||
this.tokenEndpoint = tokenEndpoint; | ||
} | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
...va/no/nav/testnav/libs/securitycore/domain/azuread/AzureTrygdeetatenClientCredential.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package no.nav.testnav.libs.securitycore.domain.azuread; | ||
|
||
import lombok.Getter; | ||
|
||
import java.util.Objects; | ||
|
||
@Getter | ||
public class AzureTrygdeetatenClientCredential extends ClientCredential { | ||
|
||
private final String tokenEndpoint; | ||
|
||
public AzureTrygdeetatenClientCredential(String tokenEndpoint, String clientId, String clientSecret) { | ||
super(clientId, clientSecret); | ||
this.tokenEndpoint = tokenEndpoint; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
if (!super.equals(o)) { | ||
return false; | ||
} | ||
return Objects.equals(tokenEndpoint, ((AzureTrygdeetatenClientCredential) o).getTokenEndpoint()); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(super.hashCode(), tokenEndpoint); | ||
} | ||
|
||
} |
15 changes: 9 additions & 6 deletions
15
...-core/src/main/java/no/nav/testnav/libs/securitycore/domain/azuread/ClientCredential.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
package no.nav.testnav.libs.securitycore.domain.azuread; | ||
|
||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Data | ||
@RequiredArgsConstructor | ||
@Getter | ||
@EqualsAndHashCode | ||
public class ClientCredential { | ||
|
||
private final String clientId; | ||
private final String clientSecret; | ||
|
||
@Override | ||
public final String toString() { | ||
return "ClientCredential{" + | ||
"clientId=[HIDDEN]" + | ||
", clientSecret=[HIDDEN]" + | ||
'}'; | ||
return "ClientCredential{clientId=[HIDDEN],clientSecret=[HIDDEN]}"; | ||
} | ||
|
||
} |
Oops, something went wrong.