mirror of
https://github.com/google/nomulus
synced 2026-02-02 19:12:27 +00:00
Refactor StringGenerator bindings
Make every dependency request explicit on what encoding is used. Also get rid of InjectRule in XjcToDomainResourceConverterTest. Random number generator providers are separated to secure and insecure ones. The insecure ones must be explicitly requested (usually for use cases where security is not of concern, for better speed). ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=217921422
This commit is contained in:
@@ -17,16 +17,13 @@ package google.registry.util;
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
/** Random string generator. */
|
||||
public class RandomStringGenerator extends StringGenerator {
|
||||
|
||||
private final SecureRandom random;
|
||||
|
||||
@Inject
|
||||
public RandomStringGenerator(@Named("alphabetBase64") String alphabet, SecureRandom random) {
|
||||
public RandomStringGenerator(String alphabet, SecureRandom random) {
|
||||
super(alphabet);
|
||||
this.random = random;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user