Skip to content

Commit

Permalink
feat: changement git-service-registry pour json-service-registry
Browse files Browse the repository at this point in the history
  • Loading branch information
nathancailbourdin committed Oct 21, 2024
1 parent df4cb9c commit d8f9b41
Show file tree
Hide file tree
Showing 22 changed files with 367 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Deploy a CAS server using the WAR Overlay method without having to downoad all t
This CAS server uses the following modules :
- **cas-server-support-ldap** as an authentication method
- **cas-server-support-redis-ticket-registry** as the ticket registry
- **cas-server-support-git-service-registry** as the service registry
- **cas-server-support-json-service-registry** as the service registry
- **cas-server-support-interrupt-webflow** to interrupt the webflow during the login phase
- **cas-server-support-oidc** to enable the OIDC protocol
- **cas-server-support-saml-idp** to act as an SAML2 identity provider
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ dependencies {
testImplementation "org.springframework.boot:spring-boot-starter-test"
implementation "org.apereo.cas:cas-server-support-ldap"
implementation "org.apereo.cas:cas-server-support-redis-ticket-registry"
implementation "org.apereo.cas:cas-server-support-git-service-registry"
implementation "org.apereo.cas:cas-server-support-json-service-registry"
implementation "org.apereo.cas:cas-server-support-jmx"
implementation "org.apereo.cas:cas-server-support-pac4j-webflow"
implementation "org.apereo.cas:cas-server-support-interrupt-webflow"
Expand Down
6 changes: 2 additions & 4 deletions src/main/resources/application-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,8 @@ cas.ticket.registry.redis.sentinel.password: GWMije5VNMe7avz

# Service registry
cas.service-registry.core.init-from-json: false
cas.service-registry.git.repository-url: https://github.com/nathancailbourdin/cas-git-service-registry-test.git
cas.service-registry.git.active-branch: main
cas.service-registry.git.branches-to-clone: main
cas.service-registry.git.clone-directory.location: file:/tmp/cas-service-registry-test
cas.service-registry.core.init-default-services: false
cas.service-registry.json.location: classpath:/services
cas.service-registry.schedule.start-delay: 10000
cas.service-registry.schedule.repeat-interval: 120000
cas.service-registry.cache.duration: 900000
Expand Down
7 changes: 7 additions & 0 deletions src/main/resources/services/servicetest-1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"@class": "org.apereo.cas.services.CasRegisteredService",
"serviceId": "^http:\/\/localhost:8001\/.*",
"name": "Service Test",
"description": "Service de test pour CI avec Puppeteer",
"id": 1
}
17 changes: 17 additions & 0 deletions src/main/resources/services/servicetest-10.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"@class": "org.apereo.cas.services.CasRegisteredService",
"serviceId": "^http:\/\/localhost:8010\/.*",
"name": "Service Test",
"description": "Service de test pour génération externalid",
"id": 10,
"attributeReleasePolicy": {
"@class": "org.apereo.cas.services.ReturnExternalIDAttributeReleasePolicy",
"internalServiceId": "SERVICE1",
"allowedAttributes": [ "java.util.ArrayList", [ "cn", "mail", "sn" ] ],
"externalIdAttributeName": "externalIdTest"
},
"webflowInterruptPolicy": {
"@class": "org.apereo.cas.services.DefaultRegisteredServiceWebflowInterruptPolicy",
"enabled": false
}
}
12 changes: 12 additions & 0 deletions src/main/resources/services/servicetest-11.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"@class": "org.apereo.cas.support.saml.services.SamlRegisteredService",
"serviceId": "^http:\/\/localhost:8011.*",
"name": "Service Test",
"description": "Service de test pour flow SAML2",
"id": 11,
"metadataLocation": "http://localhost:8011/metadata",
"webflowInterruptPolicy": {
"@class": "org.apereo.cas.services.DefaultRegisteredServiceWebflowInterruptPolicy",
"enabled": false
}
}
18 changes: 18 additions & 0 deletions src/main/resources/services/servicetest-12.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"@class": "org.apereo.cas.services.CasRegisteredService",
"serviceId": "^https:\/\/falsevaliddomain\/tokenredirectnoportal.*",
"name": "Service Test",
"description": "Service de test pour token redirection (service non portail)",
"id": 12,
"webflowInterruptPolicy": {
"@class": "org.apereo.cas.services.DefaultRegisteredServiceWebflowInterruptPolicy",
"enabled": false
},
"properties" : {
"@class" : "java.util.HashMap",
"portalRedirectionNeeded" : {
"@class" : "org.apereo.cas.services.DefaultRegisteredServiceProperty",
"values" : [ "java.util.HashSet", [ true ] ]
}
}
}
18 changes: 18 additions & 0 deletions src/main/resources/services/servicetest-13.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"@class": "org.apereo.cas.services.CasRegisteredService",
"serviceId": "^https:\/\/falsevaliddomain\/tokenredirectportal.*",
"name": "Service Test",
"description": "Service de test pour token redirection (service portail) avec mauvais token",
"id": 13,
"webflowInterruptPolicy": {
"@class": "org.apereo.cas.services.DefaultRegisteredServiceWebflowInterruptPolicy",
"enabled": false
},
"properties" : {
"@class" : "java.util.HashMap",
"portalRedirectionNeeded" : {
"@class" : "org.apereo.cas.services.DefaultRegisteredServiceProperty",
"values" : [ "java.util.HashSet", [ true ] ]
}
}
}
18 changes: 18 additions & 0 deletions src/main/resources/services/servicetest-14.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"@class": "org.apereo.cas.services.CasRegisteredService",
"serviceId": "^https:\/\/wrongdomain\/tokenredirectnoportal.*",
"name": "Service Test",
"description": "Service de test pour token redirection (service non portail) avec domaine inconnu",
"id": 14,
"webflowInterruptPolicy": {
"@class": "org.apereo.cas.services.DefaultRegisteredServiceWebflowInterruptPolicy",
"enabled": false
},
"properties" : {
"@class" : "java.util.HashMap",
"portalRedirectionNeeded" : {
"@class" : "org.apereo.cas.services.DefaultRegisteredServiceProperty",
"values" : [ "java.util.HashSet", [ true ] ]
}
}
}
18 changes: 18 additions & 0 deletions src/main/resources/services/servicetest-15.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"@class": "org.apereo.cas.services.CasRegisteredService",
"serviceId": "^https:\/\/falsevaliddomain\/tokenredirectportal.*",
"name": "Service Test",
"description": "Service de test pour token redirection (service portail) avec bon token",
"id": 15,
"webflowInterruptPolicy": {
"@class": "org.apereo.cas.services.DefaultRegisteredServiceWebflowInterruptPolicy",
"enabled": false
},
"properties" : {
"@class" : "java.util.HashMap",
"portalRedirectionNeeded" : {
"@class" : "org.apereo.cas.services.DefaultRegisteredServiceProperty",
"values" : [ "java.util.HashSet", [ true ] ]
}
}
}
18 changes: 18 additions & 0 deletions src/main/resources/services/servicetest-16.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"@class": "org.apereo.cas.services.CasRegisteredService",
"serviceId": "^http:\/\/localhost:8016\/.*",
"name": "Service Test",
"description": "Service de test pour token redirection post connexion",
"id": 16,
"webflowInterruptPolicy": {
"@class": "org.apereo.cas.services.DefaultRegisteredServiceWebflowInterruptPolicy",
"enabled": false
},
"properties" : {
"@class" : "java.util.HashMap",
"portalRedirectionNeeded" : {
"@class" : "org.apereo.cas.services.DefaultRegisteredServiceProperty",
"values" : [ "java.util.HashSet", [ true ] ]
}
}
}
30 changes: 30 additions & 0 deletions src/main/resources/services/servicetest-17.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"@class": "org.apereo.cas.services.CasRegisteredService",
"serviceId": "^https:\/\/(mappeddomain1|mappeddomain2)\/tokenredirectnoportal.*",
"name": "Service Test",
"description": "Service de test pour token redirection (service non portail) avec domaine mappé",
"id": 17,
"webflowInterruptPolicy": {
"@class": "org.apereo.cas.services.DefaultRegisteredServiceWebflowInterruptPolicy",
"enabled": false
},
"properties" : {
"@class" : "java.util.HashMap",
"portalRedirectionNeeded" : {
"@class" : "org.apereo.cas.services.DefaultRegisteredServiceProperty",
"values" : [ "java.util.HashSet", [ true ] ]
},
"domainRedirectionNeeded" : {
"@class" : "org.apereo.cas.services.DefaultRegisteredServiceProperty",
"values" : [ "java.util.HashSet", [ true ] ]
},
"DOMAIN-RED:mappeddomain1" : {
"@class" : "org.apereo.cas.services.DefaultRegisteredServiceProperty",
"values" : [ "java.util.HashSet", [ "mappeddomain3.fr" ] ]
},
"DOMAIN-RED:mappeddomain2" : {
"@class" : "org.apereo.cas.services.DefaultRegisteredServiceProperty",
"values" : [ "java.util.HashSet", [ "mappeddomain4.fr" ] ]
}
}
}
18 changes: 18 additions & 0 deletions src/main/resources/services/servicetest-18.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"@class": "org.apereo.cas.services.OidcRegisteredService",
"clientId": "client-testcas",
"clientSecret": "secret-testcas",
"serviceId": "^http:\/\/localhost:8018\/.*",
"name": "Service Test",
"description": "Service de test pour OIDC",
"id": 18,
"bypassApprovalPrompt": true,
"webflowInterruptPolicy": {
"@class": "org.apereo.cas.services.DefaultRegisteredServiceWebflowInterruptPolicy",
"enabled": false
},
"generateRefreshToken": "true",
"scopes": [ "java.util.HashSet", [ "openid", "profile", "test" ] ],
"supportedGrantTypes": [ "java.util.HashSet", [ "authorization_code", "refresh_token" ] ],
"supportedResponseTypes": [ "java.util.HashSet", [ "code" ] ]
}
13 changes: 13 additions & 0 deletions src/main/resources/services/servicetest-19.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"@class": "org.apereo.cas.services.CasRegisteredService",
"serviceId": "^http:\/\/localhost:8019\/.*",
"name": "Service Test",
"description": "Service de test pour SLO",
"id": 19,
"bypassApprovalPrompt": true,
"webflowInterruptPolicy": {
"@class": "org.apereo.cas.services.DefaultRegisteredServiceWebflowInterruptPolicy",
"enabled": false
},
"logoutUrl" : "http://localhost:8019/logout"
}
7 changes: 7 additions & 0 deletions src/main/resources/services/servicetest-2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"@class": "org.apereo.cas.services.CasRegisteredService",
"serviceId": "^http:\/\/localhost:8002\/.*",
"name": "Service Test",
"description": "Service de test pour CI avec Puppeteer (redirection)",
"id": 2
}
17 changes: 17 additions & 0 deletions src/main/resources/services/servicetest-3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"@class": "org.apereo.cas.services.CasRegisteredService",
"serviceId": "^http:\/\/localhost:8003\/.*",
"name": "Service Test",
"description": "Service de test pour TimeBasedRegisteredServiceAccessStrategy valide",
"id": 3,
"accessStrategy": {
"@class": "org.apereo.cas.services.TimeBasedRegisteredServiceAccessStrategy",
"startingDateTime": "2024-07-23T09:52:00.132+02:00",
"endingDateTime": "2094-07-23T10:05:00.132+02:00",
"zoneId": "UTC+2"
},
"webflowInterruptPolicy": {
"@class": "org.apereo.cas.services.DefaultRegisteredServiceWebflowInterruptPolicy",
"enabled": false
}
}
17 changes: 17 additions & 0 deletions src/main/resources/services/servicetest-4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"@class": "org.apereo.cas.services.CasRegisteredService",
"serviceId": "^http:\/\/localhost:8004\/.*",
"name": "Service Test",
"description": "Service de test pour TimeBasedRegisteredServiceAccessStrategy invalide",
"id": 4,
"accessStrategy": {
"@class": "org.apereo.cas.services.TimeBasedRegisteredServiceAccessStrategy",
"startingDateTime": "2024-07-23T09:52:00.132+02:00",
"endingDateTime": "2024-07-23T10:05:00.132+02:00",
"zoneId": "UTC+2"
},
"webflowInterruptPolicy": {
"@class": "org.apereo.cas.services.DefaultRegisteredServiceWebflowInterruptPolicy",
"enabled": false
}
}
23 changes: 23 additions & 0 deletions src/main/resources/services/servicetest-5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"@class": "org.apereo.cas.services.CasRegisteredService",
"serviceId": "^http:\/\/localhost:8005\/.*",
"name": "Service Test",
"description": "Service de test pour DefaultRegisteredServiceAccessStrategy",
"id": 5,
"accessStrategy": {
"@class": "org.apereo.cas.services.DefaultRegisteredServiceAccessStrategy",
"requiredAttributes": {
"@class": "java.util.HashMap",
"ENTPersonLogin": [
"java.util.HashSet",
[
"test1"
]
]
}
},
"webflowInterruptPolicy": {
"@class": "org.apereo.cas.services.DefaultRegisteredServiceWebflowInterruptPolicy",
"enabled": false
}
}
38 changes: 38 additions & 0 deletions src/main/resources/services/servicetest-6.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"@class": "org.apereo.cas.services.CasRegisteredService",
"serviceId": "^http:\/\/localhost:8006\/.*",
"name": "Service Test",
"description": "Service de test pour ChainingRegisteredServiceAccessStrategy avec un OR",
"id": 6,
"accessStrategy": {
"@class": "org.apereo.cas.services.ChainingRegisteredServiceAccessStrategy",
"strategies": [
"java.util.ArrayList",
[
{
"@class": "org.apereo.cas.services.TimeBasedRegisteredServiceAccessStrategy",
"startingDateTime": "2024-07-23T09:52:00.132+02:00",
"endingDateTime": "2024-07-23T10:05:00.132+02:00",
"zoneId": "UTC+2"
},
{
"@class": "org.apereo.cas.services.DefaultRegisteredServiceAccessStrategy",
"requiredAttributes": {
"@class": "java.util.HashMap",
"ENTPersonLogin": [
"java.util.HashSet",
[
"test1"
]
]
}
}
]
],
"operator": "OR"
},
"webflowInterruptPolicy": {
"@class": "org.apereo.cas.services.DefaultRegisteredServiceWebflowInterruptPolicy",
"enabled": false
}
}
38 changes: 38 additions & 0 deletions src/main/resources/services/servicetest-7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"@class": "org.apereo.cas.services.CasRegisteredService",
"serviceId": "^http:\/\/localhost:8007\/.*",
"name": "Service Test",
"description": "Service de test pour ChainingRegisteredServiceAccessStrategy avec un AND",
"id": 7,
"accessStrategy": {
"@class": "org.apereo.cas.services.ChainingRegisteredServiceAccessStrategy",
"strategies": [
"java.util.ArrayList",
[
{
"@class": "org.apereo.cas.services.TimeBasedRegisteredServiceAccessStrategy",
"startingDateTime": "2024-07-23T09:52:00.132+02:00",
"endingDateTime": "2094-07-23T10:05:00.132+02:00",
"zoneId": "UTC+2"
},
{
"@class": "org.apereo.cas.services.DefaultRegisteredServiceAccessStrategy",
"requiredAttributes": {
"@class": "java.util.HashMap",
"ENTPersonLogin": [
"java.util.HashSet",
[
"test1"
]
]
}
}
]
],
"operator": "AND"
},
"webflowInterruptPolicy": {
"@class": "org.apereo.cas.services.DefaultRegisteredServiceWebflowInterruptPolicy",
"enabled": false
}
}
Loading

0 comments on commit d8f9b41

Please sign in to comment.