mirror of
https://github.com/google/nomulus.git
synced 2025-08-22 17:21:08 +02:00
Add console registrars screen API support to /console-api/registrars endpoint (#2095)
This commit is contained in:
parent
68d35d2d95
commit
ec9a220bc3
13 changed files with 403 additions and 131 deletions
|
@ -14,19 +14,15 @@
|
|||
|
||||
package google.registry.util;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import dagger.Binds;
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import google.registry.util.CidrAddressBlock.CidrAddressBlockAdapter;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.ProviderException;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Random;
|
||||
import javax.inject.Named;
|
||||
import javax.inject.Singleton;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
/** Dagger module to provide instances of various utils classes. */
|
||||
@Module
|
||||
|
@ -75,13 +71,4 @@ public abstract class UtilsModule {
|
|||
return new RandomStringGenerator(StringGenerator.Alphabets.DIGITS_ONLY, secureRandom);
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
public static Gson provideGson() {
|
||||
return new GsonBuilder()
|
||||
.registerTypeAdapter(DateTime.class, new DateTimeTypeAdapter())
|
||||
.registerTypeAdapter(CidrAddressBlock.class, new CidrAddressBlockAdapter())
|
||||
.excludeFieldsWithoutExposeAnnotation()
|
||||
.create();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue