mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
fix(config): make runtime defaults explicit (#1389)
This commit is contained in:
1 parent
f01a680bff
commit
42669aaed9
12 files changed
+114
-13
No files matched your search
@@ -50,7 +50,7 @@ public interface EmulatorConfig {
|
||||
@WithDefault("000000000000")
|
||||
String defaultAccountId();
|
||||
|
||||
@WithDefault("512")
|
||||
@WithDefault("2048")
|
||||
int maxRequestSize();
|
||||
|
||||
@WithDefault("public.ecr.aws")
|
||||
@@ -506,6 +506,9 @@ public interface EmulatorConfig {
|
||||
|
||||
@WithDefault("false")
|
||||
boolean enforcementEnabled();
|
||||
|
||||
@WithDefault("false")
|
||||
boolean seedDeployerPrincipal();
|
||||
}
|
||||
|
||||
interface MskServiceConfig {
|
||||
|
||||
@@ -22,7 +22,7 @@ import jakarta.enterprise.context.ApplicationScoped;
|
||||
* </ul>
|
||||
*
|
||||
* The overall request body size is still bounded by
|
||||
* {@code quarkus.http.limits.max-body-size} (default 512 MB).
|
||||
* {@code quarkus.http.limits.max-body-size} (default 2048 MB).
|
||||
*/
|
||||
@ApplicationScoped
|
||||
public class HttpOptionsCustomizer implements HttpServerOptionsCustomizer {
|
||||
|
||||
@@ -49,6 +49,7 @@ public class IamService {
|
||||
private final StorageBackend<String, InstanceProfile> instanceProfiles;
|
||||
private final StorageBackend<String, SessionCredential> sessions;
|
||||
private final RegionResolver regionResolver;
|
||||
private final boolean seedDeployerPrincipal;
|
||||
|
||||
@Inject
|
||||
public IamService(StorageFactory storageFactory, EmulatorConfig config, RegionResolver regionResolver) {
|
||||
@@ -60,7 +61,8 @@ public class IamService {
|
||||
storageFactory.create("iam", "iam-access-keys.json", new TypeReference<>() {}),
|
||||
storageFactory.create("iam", "iam-instance-profiles.json", new TypeReference<>() {}),
|
||||
storageFactory.create("iam", "iam-sessions.json", new TypeReference<>() {}),
|
||||
regionResolver
|
||||
regionResolver,
|
||||
config.services().iam().seedDeployerPrincipal()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -72,6 +74,18 @@ public class IamService {
|
||||
StorageBackend<String, InstanceProfile> instanceProfiles,
|
||||
StorageBackend<String, SessionCredential> sessions,
|
||||
RegionResolver regionResolver) {
|
||||
this(users, groups, roles, policies, accessKeys, instanceProfiles, sessions, regionResolver, false);
|
||||
}
|
||||
|
||||
IamService(StorageBackend<String, IamUser> users,
|
||||
StorageBackend<String, IamGroup> groups,
|
||||
StorageBackend<String, IamRole> roles,
|
||||
StorageBackend<String, IamPolicy> policies,
|
||||
StorageBackend<String, AccessKey> accessKeys,
|
||||
StorageBackend<String, InstanceProfile> instanceProfiles,
|
||||
StorageBackend<String, SessionCredential> sessions,
|
||||
RegionResolver regionResolver,
|
||||
boolean seedDeployerPrincipal) {
|
||||
this.users = users;
|
||||
this.groups = groups;
|
||||
this.roles = roles;
|
||||
@@ -80,12 +94,15 @@ public class IamService {
|
||||
this.instanceProfiles = instanceProfiles;
|
||||
this.sessions = sessions;
|
||||
this.regionResolver = regionResolver;
|
||||
this.seedDeployerPrincipal = seedDeployerPrincipal;
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
void seedDefaults() {
|
||||
seedAwsManagedPolicies();
|
||||
seedDefaultDeployerPrincipal();
|
||||
if (seedDeployerPrincipal) {
|
||||
seedDefaultDeployerPrincipal();
|
||||
}
|
||||
}
|
||||
|
||||
void seedAwsManagedPolicies() {
|
||||
|
||||
Reference in new issue
Block a user