forked from alphagov/paas-uaa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'bump-75.1.0' into gds_master
- Loading branch information
Showing
134 changed files
with
1,220 additions
and
1,271 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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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" |
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
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
2 changes: 1 addition & 1 deletion
2
model/src/test/java/org/cloudfoundry/identity/uaa/mfa/MfaProviderTest.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
77 changes: 77 additions & 0 deletions
77
model/src/test/java/org/cloudfoundry/identity/uaa/mfa/RandomValueStringGenerator.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,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; | ||
} | ||
|
||
} |
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
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
Oops, something went wrong.