All Downloads are FREE. Search and download functionalities are using the official Maven repository.

one.credify.sdk.CredifyConfig Maven / Gradle / Ivy

package one.credify.sdk;

import lombok.Getter;
import one.credify.crypto.Encryption;
import one.credify.crypto.Signing;

public class CredifyConfig {
    public enum Env {
        LOCAL, DEV, SIT, UAT, SANDBOX, PRODUCTION
    }

    @Getter
    private final Signing signing;
    @Getter
    private final Encryption encryption;
    @Getter
    private final String apiKey;
    @Getter
    private final String apiUrlV1;
    @Getter
    private final String apiUrlV2;
    @Getter
    private final String oidcCoreUrl;
    @Getter
    private final String oidcAuthUrl;

    public CredifyConfig(Signing signing, Encryption encryption, String apiKey, Env env) {
        this.signing = signing;
        this.encryption = encryption;
        this.apiKey = apiKey;
        Env env1 = env != null ? env : Env.SANDBOX;

        switch (env1) {
            case LOCAL: {
                this.apiUrlV1 = "http://localhost:8000";
                this.apiUrlV2 = "http://localhost:10000";
                this.oidcCoreUrl = "http://localhost:4444";
                this.oidcAuthUrl = "http://localhost:3000";
                break;
            }
            case DEV: {
                this.apiUrlV1 = "https://dev-api.credify.ninja";
                this.apiUrlV2 = "https://dev-api.credify.ninja";
                this.oidcCoreUrl = "https://dev-oidc-core.credify.ninja";
                this.oidcAuthUrl = "https://dev-oidc-auth.credify.ninja";
                break;
            }
            case SIT: {
                this.apiUrlV1 = "https://sit-api.credify.ninja";
                this.apiUrlV2 = "https://sit-api.credify.ninja";
                this.oidcCoreUrl = "https://sit-oidc-core.credify.ninja";
                this.oidcAuthUrl = "https://sit-oidc-auth.credify.ninja";
                break;
            }
            case UAT: {
                this.apiUrlV1 = "https://uat-api.credify.dev";
                this.apiUrlV2 = "https://uat-api.credify.dev";
                this.oidcCoreUrl = "https://uat-oidc-core.credify.dev";
                this.oidcAuthUrl = "https://uat-oidc-auth.credify.dev";
                break;
            }
            case SANDBOX: {
                this.apiUrlV1 = "https://sandbox-api.credify.dev";
                this.apiUrlV2 = "https://sandbox-api.credify.dev";
                this.oidcCoreUrl = "https://sandbox-oidc-core.credify.dev";
                this.oidcAuthUrl = "https://sandbox-oidc-auth.credify.dev";
                break;
            }
            case PRODUCTION: {
                this.apiUrlV1 = "https://api.credify.one";
                this.apiUrlV2 = "https://api.credify.one";
                this.oidcCoreUrl = "https://oidc-core.credify.one";
                this.oidcAuthUrl = "https://oidc-auth.credify.one";
                break;
            }
            default: {
                this.apiUrlV1 = "https://sandbox-api.credify.dev";
                this.apiUrlV2 = "https://sandbox-api.credify.dev";
                this.oidcCoreUrl = "https://sandbox-oidc-core.credify.dev";
                this.oidcAuthUrl = "https://sandbox-oidc-auth.credify.dev";
            }
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy