2
0
mirror of https://github.com/VinylDNS/vinyldns synced 2025-08-31 14:25:30 +00:00

Support openID connect for login (#488)

* Support openID connect for login

* Add tests on oidc
This commit is contained in:
Rebecca Star
2019-02-19 11:34:45 -05:00
committed by GitHub
parent ac81fb87cf
commit c5c5bccfa9
17 changed files with 979 additions and 411 deletions

View File

@@ -31,7 +31,7 @@ import vinyldns.core.health.HealthService
import scala.util.Success
trait TestApplicationData { this: Mockito =>
val frodoDetails = UserDetails(
val frodoDetails = LdapUserDetails(
"CN=frodo,OU=hobbits,DC=middle,DC=earth",
"frodo",
Some("fbaggins@hobbitmail.me"),
@@ -84,7 +84,7 @@ trait TestApplicationData { this: Mockito =>
).toOption.get
val serviceAccountDetails =
UserDetails("CN=frodo,OU=hobbits,DC=middle,DC=earth", "service", None, None, None)
LdapUserDetails("CN=frodo,OU=hobbits,DC=middle,DC=earth", "service", None, None, None)
val serviceAccount =
User("service", "key", "secret", None, None, None, DateTime.now, "service-uuid")
@@ -108,7 +108,7 @@ trait TestApplicationData { this: Mockito =>
Some("sgamgee@hobbitmail.me"),
DateTime.now,
"sam-uuid")
val samDetails = UserDetails(
val samDetails = LdapUserDetails(
"CN=sam,OU=hobbits,DC=middle,DC=earth",
"sam",
Some("sgamgee@hobbitmail.me"),
@@ -222,9 +222,12 @@ trait TestApplicationData { this: Mockito =>
val simulatedBackendPort: Int = 9001
val testConfig: Configuration =
val testConfigLdap: Configuration =
Configuration.load(Environment.simple()) ++ Configuration.from(
Map("portal.vinyldns.backend.url" -> s"http://localhost:$simulatedBackendPort"))
Map(
"portal.vinyldns.backend.url" -> s"http://localhost:$simulatedBackendPort",
"oidc.enabled" -> false)
)
val mockAuth: Authenticator = mock[Authenticator]
val mockUserRepo: UserRepository = mock[UserRepository]
@@ -244,6 +247,6 @@ trait TestApplicationData { this: Mockito =>
bind[CryptoAlgebra].to(new NoOpCrypto()),
bind[HealthService].to(new HealthService(List()))
)
.configure(testConfig)
.configure(testConfigLdap)
.build()
}