Add console registrars screen API support to /console-api/registrars endpoint (#2095)

This commit is contained in:
Pavlo Tkach 2023-08-17 10:17:23 -04:00 committed by GitHub
parent 68d35d2d95
commit ec9a220bc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 403 additions and 131 deletions

View file

@ -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();
}
}