Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump k8s.io/client-go from 0.20.1 to 0.21.0 in /k8s #6

Open
wants to merge 57 commits into
base: gds_master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
b898a73
Update UAA image reference in k8s deployment template to cfidentity/u…
cf-identity Jan 13, 2021
e171f0f
Bump k8s.io/api from 0.20.1 to 0.20.2 in /k8s (#1494)
dependabot[bot] Jan 14, 2021
30d3d97
Update UAA image reference in k8s deployment template to cfidentity/u…
cf-identity Jan 14, 2021
1f4e967
Support multiple oauth client secrets in uaa.yml (#1313)
phschon Jan 15, 2021
56d0ab0
Bump k8s.io/client-go from 0.20.1 to 0.20.2 in /k8s (#1495)
dependabot[bot] Jan 15, 2021
237d8c2
Update UAA image reference in k8s deployment template to cfidentity/u…
cf-identity Jan 15, 2021
d6672cd
Bump jasmine from 3.6.1 to 3.6.3 in /uaa (#1493)
dependabot[bot] Jan 15, 2021
276feda
fix issue #1447: bump velocity 2.2 (#1486)
strehle Jan 15, 2021
82fe0ca
Update UAA image reference in k8s deployment template to cfidentity/u…
cf-identity Jan 15, 2021
eadedec
Bump - spring boot 2.4.1 - framework 5.3.2 (#1484)
strehle Jan 18, 2021
8bd52d7
fix leftover from spring boot update (#1499)
strehle Jan 18, 2021
03324ff
Alphabetize dependencies.gradle (#1500)
strehle Jan 19, 2021
141c510
Bump - spring boot 2.4.2 - framework 5.3.3 (#1501)
strehle Jan 19, 2021
2bd4e2d
Bump jasmine from 3.6.3 to 3.6.4 in /uaa (#1502)
dependabot[bot] Jan 19, 2021
afb7083
Update UAA image reference in k8s deployment template to cfidentity/u…
cf-identity Jan 19, 2021
6d9bdc9
Bump version spring oauth 2.5.0.RELEASE (#1462)
strehle Jan 19, 2021
ce92ed9
use test class (#1503)
strehle Jan 20, 2021
8edd549
refactor: use old RandomValueStringGenerator for internal tests (#1504)
strehle Jan 20, 2021
a6634e3
refactor: use old RandomValueStringGenerator for doc classes (#1505)
strehle Jan 20, 2021
2dd7134
refactor tests (#1506)
strehle Jan 20, 2021
e882d51
Update UAA image reference in k8s deployment template to cfidentity/u…
cf-identity Jan 20, 2021
a95df9f
Credentials in UsernamePasswordAuthenticationToken should be String (…
mikeroda Jan 21, 2021
6cbe452
prevent issues during pollution (#1509)
strehle Jan 21, 2021
817ab51
Update UAA image reference in k8s deployment template to cfidentity/u…
cf-identity Jan 21, 2021
1f1c24b
refactor: use old RandomValueStringGenerator for doc classes (#1508)
strehle Jan 21, 2021
b054889
Bump bouncyCastleVersion from 1.67 to 1.68 (#1510)
strehle Jan 21, 2021
b993959
Update UAA image reference in k8s deployment template to cfidentity/u…
cf-identity Jan 21, 2021
4acae05
Update jQuery version to v3.5.1
strehle Jan 22, 2021
a392fbc
Merge pull request #1513 from cloudfoundry/strehle/fix/issue1340
reedr3 Jan 26, 2021
34d7e35
Update UAA image reference in k8s deployment template to cfidentity/u…
cf-identity Jan 26, 2021
b211882
Update logging timestamp format to conform to rfc3339 & cf-rfc030
peterhaochen47 Jan 27, 2021
fec2085
Update UAA image reference in k8s deployment template to cfidentity/u…
cf-identity Jan 27, 2021
cb309b1
Document UAA server docker image's migration to `cloundfoundry/uaa` repo
peterhaochen47 Jan 27, 2021
46cc261
re-point test to cfidentity dockerhub
peterhaochen47 Jan 27, 2021
7cbf3c1
Update UAA image reference in k8s deployment template to cloudfoundry…
cf-identity Jan 28, 2021
814cf89
Revert "re-point test to cfidentity dockerhub"
peterhaochen47 Jan 28, 2021
e8a8458
Update UAA image reference in k8s deployment template to cloudfoundry…
cf-identity Jan 28, 2021
333954d
Restructure login method to not read all IdentityProviders on login_hint
tack-sap Nov 10, 2020
0e31bb4
Move read configurations and parameters to allow earlier decisions
tack-sap Nov 12, 2020
7e7c376
Fix bug with invalid login_hint on login page
tack-sap Jan 29, 2021
c32c349
Add MockMvc Test to show performance improvement
tack-sap Jan 29, 2021
e21ece5
Update UAA image reference in k8s deployment template to cloudfoundry…
cf-identity Feb 3, 2021
ecf3734
Bump dependency
bruce-ricard Feb 4, 2021
9834fc3
Update UAA image reference in k8s deployment template to cloudfoundry…
cf-identity Feb 14, 2021
fdd4e72
feat: for unit tests, add time out to waiting for DB to start
peterhaochen47 Feb 25, 2021
766e981
Fix typo
RageZBla Oct 26, 2020
c88dfff
refactor: implement recommendation from thymeleaf (#1512)
strehle Mar 19, 2021
2d0e75c
Dependeny Updagtes (#1538)
strehle Mar 22, 2021
411b141
Bump github.com/onsi/gomega from 1.10.4 to 1.11.0 in /k8s (#1532)
dependabot[bot] Mar 22, 2021
f1450a4
refactor: rename
bruce-ricard Mar 12, 2021
b23937c
Bump k8s.io/api from 0.20.2 to 0.20.5 in /k8s (#1542)
dependabot[bot] Mar 23, 2021
2ce502f
Bump github.com/onsi/ginkgo from 1.14.2 to 1.15.2 in /k8s (#1535)
dependabot[bot] Mar 23, 2021
7e7c544
Bump k8s.io/client-go from 0.20.2 to 0.20.5 in /k8s (#1541)
dependabot[bot] Mar 23, 2021
2776c98
Update UAA image reference in k8s deployment template to 75.1.0
cf-identity Apr 9, 2021
7fa2dc4
Do not expire invitations on GET requests
richardTowers Oct 23, 2019
e071137
Merge branch 'bump-75.1.0' into gds_master
schmie Apr 16, 2021
47f239a
Bump k8s.io/client-go from 0.20.1 to 0.21.0 in /k8s
dependabot[bot] Apr 16, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ ext["flyway.version"] = "5.2.4"
// Versions shared between multiple dependencies
versions.aspectJVersion = "1.9.4"
versions.apacheDsVersion = "2.0.0.AM26"
versions.bouncyCastleVersion = "1.67"
versions.bouncyCastleVersion = "1.68"
versions.hamcrestVersion = "2.2"
versions.springBootVersion = "2.3.7.RELEASE"
versions.springBootVersion = "2.4.4"
versions.springSecurityJwtVersion = "1.1.1.RELEASE"
versions.springSecurityOAuthVersion = "2.4.0.RELEASE"
versions.springSecurityOAuthVersion = "2.5.0.RELEASE"
versions.springSecuritySamlVersion = "1.0.10.RELEASE"
versions.springVersion = "5.2.12.RELEASE"
versions.springVersion = "5.3.5"
versions.xmlBind = "2.3.0.1"
versions.tomcatCargoVersion = "9.0.41"
versions.tomcatCargoVersion = "9.0.44"

// Dependencies (some rely on shared versions, some are shared between projects)
libraries.apacheCommonsRngCore = "org.apache.commons:commons-rng-core:1.3"
Expand All @@ -28,6 +28,7 @@ libraries.apacheDsProtocolLdap = "org.apache.directory.server:apacheds-protocol-
libraries.apacheLdapApi = "org.apache.directory.api:api-ldap-model:1.0.3"
libraries.aspectJRt = "org.aspectj:aspectjrt"
libraries.aspectJWeaver = "org.aspectj:aspectjweaver"
libraries.beanutils = "commons-beanutils:commons-beanutils:1.9.4"
libraries.bouncyCastlePkix = "org.bouncycastle:bcpkix-jdk15on:${versions.bouncyCastleVersion}"
libraries.bouncyCastleProv = "org.bouncycastle:bcprov-jdk15on:${versions.bouncyCastleVersion}"
libraries.commonsIo = "commons-io:commons-io:2.7"
Expand Down Expand Up @@ -63,7 +64,6 @@ libraries.mariaJdbcDriver = "org.mariadb.jdbc:mariadb-java-client"
libraries.mockito = "org.mockito:mockito-core"
libraries.mockitoJunit5 = "org.mockito:mockito-junit-jupiter"
libraries.passay = "org.passay:passay:1.6.0"
libraries.beanutils = "commons-beanutils:commons-beanutils:1.9.4"
libraries.postgresql = "org.postgresql:postgresql"
libraries.selenium = "org.seleniumhq.selenium:selenium-java"
libraries.slf4jApi = "org.slf4j:slf4j-api"
Expand Down Expand Up @@ -108,6 +108,7 @@ libraries.tomcatJasperEl = "org.apache.tomcat.embed:tomcat-embed-jasper"
libraries.tomcatJdbc = "org.apache.tomcat:tomcat-jdbc"
libraries.unboundIdLdapSdk = "com.unboundid:unboundid-ldapsdk"
libraries.unboundIdScimSdk = "com.unboundid.product.scim:scim-sdk:1.8.24"
libraries.velocity = "org.apache.velocity:velocity-engine-core:2.2"
libraries.zxing = "com.google.zxing:javase:3.4.0"

// gradle plugins
Expand Down
12 changes: 6 additions & 6 deletions k8s/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,33 @@ The UAA uses the driver provided by mariadb (`org.mariadb.jdbc:mariadb-java-clie

The typical structure will look like `database.url=jdbc:mysql://<HOST>:<PORT>/<DB-NAME>?useSSL=false|true`, with whatever other params you may need to use.

## Testing image `cfidentity/uaa`
## Testing image `cloudfoundry/uaa`

To switch between the minikube docker daemon and the local docker daemon, use these commands:

For minikube's docker daemon: `eval "$(minikube docker-env)"`

For the local docker daemon: `eval "$(minikube docker-env --unset=true)"`

To test image `cfidentity/uaa`, you can make use of these sample docker commands:
To test image `cloudfoundry/uaa`, you can make use of these sample docker commands:

### Docker Run

```shell script
docker pull cfidentity/uaa:latest \
docker pull cloudfoundry/uaa:latest \
&& docker run \
--detach \
--publish 8080:8080 \
--mount type=bind,source=${PWD}/../scripts/cargo/uaa.yml,target=/uaa.yml \
--env CLOUDFOUNDRY_CONFIG_PATH= \
--env spring_profiles=default,hsqldb \
cfidentity/uaa:latest
cloudfoundry/uaa:latest
```

### Docker Debug

```shell script
docker pull cfidentity/uaa:latest \
docker pull cloudfoundry/uaa:latest \
&& docker run \
--detach \
--publish 8080:8080 \
Expand All @@ -51,5 +51,5 @@ docker pull cfidentity/uaa:latest \
--env CLOUDFOUNDRY_CONFIG_PATH= \
--env spring_profiles=default,hsqldb \
--env JAVA_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -Djava.security.egd=file:/dev/./urandom" \
cfidentity/uaa:latest
cloudfoundry/uaa:latest
```
10 changes: 5 additions & 5 deletions k8s/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module github.com/cloudfoundry/uaa
go 1.15

require (
github.com/onsi/ginkgo v1.14.2
github.com/onsi/gomega v1.10.4
github.com/onsi/ginkgo v1.15.2
github.com/onsi/gomega v1.11.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.20.1
k8s.io/apimachinery v0.20.1
k8s.io/client-go v0.20.1
k8s.io/api v0.21.0
k8s.io/apimachinery v0.21.0
k8s.io/client-go v0.21.0
)
114 changes: 52 additions & 62 deletions k8s/go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion k8s/templates/log4j2.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ status = error
dest = err
name = UaaLog

property.log_pattern=[%d{yyyy-MM-dd HH:mm:ss.SSS}] uaa%X{context} - %pid [%t] .... %5p --- %c{1}: %replace{%m}{(?<=password=|client_secret=)([^&]*)}{<redacted>}%n
property.log_pattern=[%d{yyyy-MM-dd'T'HH:mm:ss.nnnnnn}{GMT+0}Z] uaa%X{context} - %pid [%t] .... %5p --- %c{1}: %replace{%m}{(?<=password=|client_secret=)([^&]*)}{<redacted>}%n

appender.uaaDefaultAppender.type = Console
appender.uaaDefaultAppender.name = UaaDefaultAppender
Expand Down
2 changes: 1 addition & 1 deletion k8s/templates/values/image.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#@data/values
---
image: "index.docker.io/cfidentity/uaa@sha256:7a3ded9ec4d090ae2450a4259ab402e64ef1401d711895259fea4bbf59304069"
image: "index.docker.io/cloudfoundry/uaa@sha256:125fe387c0d722d78968707738e9daa09be04688f3cb4445f941bdfe939aabf1"
2 changes: 1 addition & 1 deletion k8s/test/config_map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ var _ = Describe("Uaa ConfigMap", func() {
dest = err
name = UaaLog

property.log_pattern=[%d{yyyy-MM-dd HH:mm:ss.SSS}] uaa%X{context} - %pid [%t] .... %5p --- %c{1}: %replace{%m}{(?<=password=|client_secret=)([^&]*)}{<redacted>}%n
property.log_pattern=[%d{yyyy-MM-dd'T'HH:mm:ss.nnnnnn}{GMT+0}Z] uaa%X{context} - %pid [%t] .... %5p --- %c{1}: %replace{%m}{(?<=password=|client_secret=)([^&]*)}{<redacted>}%n

appender.uaaDefaultAppender.type = Console
appender.uaaDefaultAppender.name = UaaDefaultAppender
Expand Down
2 changes: 1 addition & 1 deletion k8s/test/deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ var _ = Describe("Deployment", func() {
pod.WithServiceAccountMatching("uaa")
pod.WithContainerMatching(func(container *ContainerMatcher) {
container.WithName("uaa")
container.WithImageContaining("cfidentity/uaa@sha256:")
container.WithImageContaining("cloudfoundry/uaa@sha256:")
container.WithEnvVar("BPL_TOMCAT_ACCESS_LOGGING", "y")
container.WithEnvVar("JAVA_OPTS", strings.Join(expectedJavaOpts, " "))
container.WithVolumeMount("uaa-config", Not(BeNil()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class ClaimConstants {
public static final String EMAIL = "email";
public static final String EMAIL_VERIFIED = "email_verified";
public static final String CLIENT_ID = "client_id";
public static final String EXP = "exp";
public static final String EXPIRY_IN_SECONDS = "exp";
public static final String AUTHORITIES = "authorities";
public static final String SCOPE = "scope";
public static final String GRANTED_SCOPES = "granted_scopes";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class Claims {
private String email;
@JsonProperty(ClaimConstants.CLIENT_ID)
private String clientId;
@JsonProperty(ClaimConstants.EXP)
@JsonProperty(ClaimConstants.EXPIRY_IN_SECONDS)
private Long exp;
@JsonProperty(ClaimConstants.AUTHORITIES)
private List<String> authorities;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.cloudfoundry.identity.uaa.mfa;

import com.fasterxml.jackson.databind.JsonNode;
import org.cloudfoundry.identity.uaa.mfa.RandomValueStringGenerator;
import org.cloudfoundry.identity.uaa.util.JsonUtils;
import org.cloudfoundry.identity.uaa.zone.IdentityZone;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.springframework.security.oauth2.common.util.RandomValueStringGenerator;

import java.util.Date;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package org.cloudfoundry.identity.uaa.mfa;

import java.security.SecureRandom;
import java.util.Random;

/**
* Utility that generates a random-value ASCII string.
*
* @author Ryan Heaton
* @author Dave Syer
*/
public class RandomValueStringGenerator {

private static final char[] DEFAULT_CODEC = "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
.toCharArray();

private Random random = new SecureRandom();

private int length;

/**
* Create a generator with the default length (6).
*/
public RandomValueStringGenerator() {
this(6);
}

/**
* Create a generator of random strings of the length provided
*
* @param length the length of the strings generated
*/
public RandomValueStringGenerator(int length) {
this.length = length;
}

public String generate() {
byte[] verifierBytes = new byte[length];
random.nextBytes(verifierBytes);
return getAuthorizationCodeString(verifierBytes);
}

/**
* Convert these random bytes to a verifier string. The length of the byte array can be
* {@link #setLength(int) configured}. The default implementation mods the bytes to fit into the
* ASCII letters 1-9, A-Z, a-z .
*
* @param verifierBytes The bytes.
* @return The string.
*/
protected String getAuthorizationCodeString(byte[] verifierBytes) {
char[] chars = new char[verifierBytes.length];
for (int i = 0; i < verifierBytes.length; i++) {
chars[i] = DEFAULT_CODEC[((verifierBytes[i] & 0xFF) % DEFAULT_CODEC.length)];
}
return new String(chars);
}

/**
* The random value generator used to create token secrets.
*
* @param random The random value generator used to create token secrets.
*/
public void setRandom(Random random) {
this.random = random;
}

/**
* The length of string to generate.
*
* @param length the length to set
*/
public void setLength(int length) {
this.length = length;
}

}
2 changes: 1 addition & 1 deletion scripts/cargo/log4j2.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ status = error
dest = err
name = UaaLog

property.log_pattern=[%d{yyyy-MM-dd HH:mm:ss.SSS}] uaa%X{context} - %pid [%t] .... %5p --- %c{1}: %replace{%m}{(?<=password=|client_secret=)([^&]*)}{<redacted>}%n
property.log_pattern=[%d{yyyy-MM-dd'T'HH:mm:ss.nnnnnn}{GMT+0}Z] uaa%X{context} - %pid [%t] .... %5p --- %c{1}: %replace{%m}{(?<=password=|client_secret=)([^&]*)}{<redacted>}%n

appender.uaaDefaultAppender.type = File
appender.uaaDefaultAppender.name = UaaDefaultAppender
Expand Down
17 changes: 13 additions & 4 deletions scripts/start_db_helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ function bootDB {
db=$1

if [[ "${db}" = "postgresql" ]]; then
launchDB="(/docker-entrypoint.sh postgres -c 'max_connections=250' &> /var/log/postgres-boot.log) &"
bootLogLocation="/var/log/postgres-boot.log"
launchDB="(/docker-entrypoint.sh postgres -c 'max_connections=250' &> ${bootLogLocation}) &"
testConnection="(! ps aux | grep docker-entrypoint | grep -v 'grep') && psql -h localhost -U postgres -c '\conninfo' &>/dev/null"
initDB="psql -c 'drop database if exists uaa;' -U postgres; psql -c 'create database uaa;' -U postgres; psql -c 'drop user if exists root;' --dbname=uaa -U postgres; psql -c \"create user root with superuser password 'changeme';\" --dbname=uaa -U postgres; psql -c 'show max_connections;' --dbname=uaa -U postgres;"

Expand All @@ -27,7 +28,8 @@ function bootDB {


elif [[ "${db}" = "mysql" ]] || [[ "${db}" = "mysql-5.6" ]]; then
launchDB="(MYSQL_DATABASE=uaa MYSQL_ROOT_HOST=127.0.0.1 MYSQL_ROOT_PASSWORD='changeme' bash /entrypoint.sh mysqld &> /var/log/mysql-boot.log) &"
bootLogLocation="/var/log/mysql-boot.log"
launchDB="(MYSQL_DATABASE=uaa MYSQL_ROOT_HOST=127.0.0.1 MYSQL_ROOT_PASSWORD='changeme' bash /entrypoint.sh mysqld &> ${bootLogLocation}) &"
testConnection="echo '\s;' | mysql -uroot -pchangeme &>/dev/null"
initDB="mysql -uroot -pchangeme -e 'SET GLOBAL max_connections = 250; ALTER DATABASE uaa DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;';"

Expand All @@ -37,7 +39,8 @@ function bootDB {
}

elif [[ "${db}" = "percona" ]]; then
launchDB="bash /entrypoint.sh &> /var/log/mysql-boot.log"
bootLogLocation="/var/log/mysql-boot.log"
launchDB="bash /entrypoint.sh &> ${bootLogLocation}"
testConnection="echo '\s;' | mysql &>/dev/null"
initDB="mysql -e \"CREATE USER 'root'@'127.0.0.1' IDENTIFIED BY 'changeme' ;\";
mysql -e \"GRANT ALL ON *.* TO 'root'@'127.0.0.1' WITH GRANT OPTION ;\";
Expand All @@ -60,7 +63,9 @@ function bootDB {
echo -n "Booting $db"
set -x
eval "$launchDB"
while true; do

for i in {0..600} # wait at most 10 mins to the database to start
do
set +ex
eval "$testConnection"
exitcode=$?
Expand All @@ -80,4 +85,8 @@ function bootDB {
echo -n "."
sleep 1
done

echo "Printing database boot logs:"
cat "$bootLogLocation"
exit 1
}
1 change: 1 addition & 0 deletions server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ dependencies {

implementation(libraries.passay)
implementation(libraries.beanutils)
implementation(libraries.velocity)

implementation(libraries.googleAuth)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ public void setDelegates(AuthenticationManagerConfiguration[] delegates) {

@Override
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
if (authentication == null) {
return authentication;
if (!(authentication instanceof Authentication)) {
return null;
}
UsernamePasswordAuthenticationToken output = null;
if (authentication instanceof UsernamePasswordAuthenticationToken) {
output = (UsernamePasswordAuthenticationToken) authentication;
} else {
output = new UsernamePasswordAuthenticationToken(authentication.getPrincipal(),
authentication.getCredentials(),
(authentication.getCredentials() != null ? authentication.getCredentials().toString() : null),
authentication.getAuthorities());
output.setDetails(authentication.getDetails());
}
Expand Down
Loading