Skip to content

Commit cfe7adf

Browse files
committed
refactor cassandra ticket registry impl to store attributes as documents for easier searching and indexing
1 parent d940412 commit cfe7adf

File tree

36 files changed

+254
-120
lines changed

36 files changed

+254
-120
lines changed

api/cas-server-core-api-services/src/main/java/org/apereo/cas/services/RegisteredServiceDelegatedAuthenticationPolicy.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,21 @@ default boolean isProviderAllowed(final String provider, final RegisteredService
6767
*/
6868
@JsonIgnore
6969
default boolean isProviderRequired() {
70-
return isExclusive() && (!getAllowedProviders().isEmpty() || (getAllowedProviders().isEmpty() && !isPermitUndefined()));
70+
return isExclusive() && getAllowedProviders() != null
71+
&& (!getAllowedProviders().isEmpty() || (getAllowedProviders().isEmpty() && !isPermitUndefined()));
7172
}
7273

74+
/**
75+
* Is exclusive to provider?.
76+
*
77+
* @param name the name
78+
* @return the boolean
79+
*/
80+
@JsonIgnore
81+
default boolean isExclusiveToProvider(final String name) {
82+
return isExclusive()
83+
&& getAllowedProviders() != null
84+
&& getAllowedProviders().size() == 1
85+
&& name.equalsIgnoreCase(getAllowedProviders().iterator().next());
86+
}
7387
}

ci/tests/aws/run-aws-server.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ docker run --rm -d -e 'DEBUG=1' -e 'SERVICES=ssm,events,cloudwatch,logs,s3,s3api
1111
docker ps | grep "localstack"
1212
retVal=$?
1313
if [ $retVal == 0 ]; then
14-
echo "localstack docker image is running."
14+
echo "localstack docker container is running."
1515
else
16-
echo "localstack docker image failed to start."
16+
echo "localstack docker container failed to start."
1717
exit $retVal
1818
fi

ci/tests/cassandra/cassandra.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ seed_provider:
464464
parameters:
465465
# seeds is actually a comma-delimited list of addresses.
466466
# Ex: "<ip1>,<ip2>,<ip3>"
467-
- seeds: "172.17.0.2"
467+
- seeds: "172.17.0.3"
468468

469469
# For workloads with more data than can fit in memory, Cassandra's
470470
# bottleneck will be reads that need to fetch data from
@@ -664,7 +664,7 @@ ssl_storage_port: 7001
664664
#
665665
# Setting listen_address to 0.0.0.0 is always wrong.
666666
#
667-
listen_address: 172.17.0.2
667+
listen_address: 172.17.0.3
668668

669669
# Set listen_address OR listen_interface, not both. Interfaces must correspond
670670
# to a single address, IP aliasing is not supported.
@@ -678,7 +678,7 @@ listen_address: 172.17.0.2
678678

679679
# Address to broadcast to other Cassandra nodes
680680
# Leaving this blank will set it to the same value as listen_address
681-
broadcast_address: 172.17.0.2
681+
broadcast_address: 172.17.0.3
682682

683683
# When using multiple physical network interfaces, set this
684684
# to true to listen on broadcast_address in addition to
@@ -748,7 +748,7 @@ native_transport_allow_older_protocols: true
748748
# set broadcast_rpc_address to a value other than 0.0.0.0.
749749
#
750750
# For security reasons, you should not expose this port to the internet. Firewall it if needed.
751-
rpc_address: 0.0.0.0
751+
rpc_address: 0.0.0.0
752752

753753
# Set rpc_address OR rpc_interface, not both. Interfaces must correspond
754754
# to a single address, IP aliasing is not supported.
@@ -764,7 +764,7 @@ rpc_address: 0.0.0.0
764764
# be set to 0.0.0.0. If left blank, this will be set to the value of
765765
# rpc_address. If rpc_address is set to 0.0.0.0, broadcast_rpc_address must
766766
# be set.
767-
broadcast_rpc_address: 172.17.0.2
767+
broadcast_rpc_address: 172.17.0.3
768768

769769
# enable or disable keepalive on rpc/native connections
770770
rpc_keepalive: true
@@ -1408,7 +1408,7 @@ enable_materialized_views: false
14081408

14091409
# Enables SASI index creation on this node.
14101410
# SASI indexes are considered experimental and are not recommended for production use.
1411-
enable_sasi_indexes: false
1411+
enable_sasi_indexes: true
14121412

14131413
# Enables creation of transiently replicated keyspaces on this node.
14141414
# Transient replication is experimental and is not recommended for production use.

ci/tests/cassandra/run-cassandra-server.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,17 @@ docker run --rm --name cassandra -d -p 7199:7199 -p 7000:7000 -p 7001:7001 -p 90
1111
-v "$PWD"/ci/tests/cassandra/cassandra.yaml:/etc/cassandra/cassandra.yaml \
1212
-v "$PWD"/ci/tests/cassandra/cqlshrc:/root/.cassandra/cqlshrc \
1313
-v "$PWD"/ci/tests/cassandra/security:/security \
14+
-e CASSANDRA_USER=cassandra -e CASSANDRA_PASSWORD=cassandra \
1415
cassandra:4.1.0
1516

1617
#docker logs -f cassandra &
1718

1819
docker ps | grep "cassandra"
1920
retVal=$?
2021
if [ $retVal == 0 ]; then
21-
echo "Cassandra docker image is running."
22+
echo "Cassandra docker container is running."
2223
else
23-
echo "Cassandra docker image failed to start."
24+
echo "Cassandra docker container failed to start."
2425
exit $retVal
2526
fi
2627

@@ -32,7 +33,7 @@ docker exec cassandra cqlsh --ssl -e "CREATE KEYSPACE cas WITH REPLICATION = {'c
3233
sleep 5
3334

3435
echo "Creating new super user: cassystem"
35-
docker exec cassandra cqlsh --ssl -e "CREATE ROLE cassystem WITH PASSWORD = 'RUstriFINFiENtrO' AND SUPERUSER = true AND LOGIN = true"
36+
docker exec cassandra cqlsh --ssl -u cassandra -p cassandra -e "CREATE ROLE cassystem WITH PASSWORD = 'RUstriFINFiENtrO' AND SUPERUSER = true AND LOGIN = true"
3637
sleep 5
3738

3839
echo "Creating Cassandra users table"

ci/tests/couchbase/run-couchbase-server.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ createPrimaryIndex
121121
docker ps | grep "couchbase"
122122
retVal=$?
123123
if [ $retVal == 0 ]; then
124-
echo "Couchbase docker image is running."
124+
echo "Couchbase docker container is running."
125125
else
126-
echo "Couchbase docker image failed to start."
126+
echo "Couchbase docker container failed to start."
127127
exit $retVal
128128
fi

ci/tests/couchdb/run-couchdb-server.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ docker run --rm -d -e COUCHDB_USER=admin -e COUCHDB_PASSWORD=password \
1111
docker ps | grep "couchdb-server"
1212
retVal=$?
1313
if [ $retVal == 0 ]; then
14-
echo "CouchDb docker image is running."
14+
echo "CouchDb docker container is running."
1515
else
16-
echo "CouchDb docker image failed to start."
16+
echo "CouchDb docker container failed to start."
1717
exit $retVal
1818
fi
1919

ci/tests/dynamodb/run-dynamodb-server.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ docker run --rm -d -p 8000:8000 --name "dynamodb-server" amazon/dynamodb-local:1
99
docker ps | grep "dynamodb-server"
1010
retVal=$?
1111
if [ $retVal == 0 ]; then
12-
echo "DynamoDb docker image is running."
12+
echo "DynamoDb docker container is running."
1313
else
14-
echo "DynamoDb docker image failed to start."
14+
echo "DynamoDb docker container failed to start."
1515
exit $retVal
1616
fi

ci/tests/influxdb/run-influxdb-server.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ docker exec influxdb-server influx bucket create \
1616
docker ps | grep "influxdb-server"
1717
retVal=$?
1818
if [ $retVal == 0 ]; then
19-
echo "InfluxDb docker image is running."
19+
echo "InfluxDb docker container is running."
2020
else
21-
echo "InfluxDb docker image failed to start."
21+
echo "InfluxDb docker container failed to start."
2222
exit $retVal
2323
fi

ci/tests/ldap/run-ldap-server.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ docker run --rm -d -p 10389:389 -p 1389:389 --name="ldap-server" mmoayyed/ldap
99
docker ps | grep "ldap-server"
1010
retVal=$?
1111
if [ $retVal == 0 ]; then
12-
echo "LDAP docker image is running."
12+
echo "LDAP docker container is running."
1313
else
14-
echo "LDAP docker image failed to start."
14+
echo "LDAP docker container failed to start."
1515
exit $retVal
1616
fi
1717

@@ -26,8 +26,8 @@ osixia/openldap --copy-service --loglevel debug
2626
docker ps | grep "openldap-server"
2727
retVal=$?
2828
if [ $retVal == 0 ]; then
29-
echo "OpenLDAP docker image is running."
29+
echo "OpenLDAP docker container is running."
3030
else
31-
echo "OpenLDAP docker image failed to start."
31+
echo "OpenLDAP docker container failed to start."
3232
exit $retVal
3333
fi

ci/tests/mail/run-mail-server.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ docker run --rm -d -p25000:25000 -p8282:8282 --name "email-server" mmoayyed/mock
99
docker ps | grep "email-server"
1010
retVal=$?
1111
if [ $retVal == 0 ]; then
12-
echo "MockMock docker image is running."
12+
echo "MockMock docker container is running."
1313
else
14-
echo "MockMock docker image failed to start."
14+
echo "MockMock docker container failed to start."
1515
exit $retVal
1616
fi

0 commit comments

Comments
 (0)