diff --git a/.env-api.sample b/.env-api.sample index a08ee23e6..c2bd232c1 100644 --- a/.env-api.sample +++ b/.env-api.sample @@ -9,5 +9,5 @@ ISSUER_API_UI_SCHEMA_CACHE=false ISSUER_API_IDENTITY_METHOD=polygonid ISSUER_API_IDENTITY_BLOCKCHAIN=polygon ISSUER_API_IDENTITY_NETWORK=mumbai -ISSUER_API_KEY_TYPE=BJJ +ISSUER_API_UI_KEY_TYPE=BJJ ISSUER_API_ENVIRONMENT=local diff --git a/cmd/issuer_initializer/main.go b/cmd/issuer_initializer/main.go index 35ddf04f3..f0296a16e 100644 --- a/cmd/issuer_initializer/main.go +++ b/cmd/issuer_initializer/main.go @@ -11,6 +11,7 @@ import ( "github.com/ethereum/go-ethereum/ethclient" vault "github.com/hashicorp/vault/api" core "github.com/iden3/go-iden3-core/v2" + "github.com/iden3/go-schema-processor/v2/verifiable" "github.com/polygonid/sh-id-platform/internal/buildinfo" "github.com/polygonid/sh-id-platform/internal/config" @@ -131,10 +132,11 @@ func main() { identityService := services.NewIdentity(keyStore, identityRepository, mtRepository, identityStateRepository, mtService, nil, claimsRepository, nil, nil, storage, nil, nil, nil, cfg.CredentialStatus, rhsFactory, revocationStatusResolver) didCreationOptions := &ports.DIDCreationOptions{ - Method: core.DIDMethod(cfg.APIUI.IdentityMethod), - Network: core.NetworkID(cfg.APIUI.IdentityNetwork), - Blockchain: core.Blockchain(cfg.APIUI.IdentityBlockchain), - KeyType: kms.KeyType(cfg.APIUI.KeyType), + Method: core.DIDMethod(cfg.APIUI.IdentityMethod), + Network: core.NetworkID(cfg.APIUI.IdentityNetwork), + Blockchain: core.Blockchain(cfg.APIUI.IdentityBlockchain), + KeyType: kms.KeyType(cfg.APIUI.KeyType), + AuthBJJCredentialStatus: verifiable.CredentialStatusType(cfg.CredentialStatus.CredentialStatusType), } identity, err := identityService.Create(ctx, cfg.ServerUrl, didCreationOptions) diff --git a/internal/config/config.go b/internal/config/config.go index f64ca6be0..a95effd61 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -441,7 +441,7 @@ func bindEnv() { _ = viper.BindEnv("APIUI.IdentityMethod", "ISSUER_API_IDENTITY_METHOD") _ = viper.BindEnv("APIUI.IdentityBlockchain", "ISSUER_API_IDENTITY_BLOCKCHAIN") _ = viper.BindEnv("APIUI.IdentityNetwork", "ISSUER_API_IDENTITY_NETWORK") - _ = viper.BindEnv("APIUI.KeyType", "ISSUER_API_KEY_TYPE") + _ = viper.BindEnv("APIUI.KeyType", "ISSUER_API_UI_KEY_TYPE") viper.AutomaticEnv() } @@ -568,7 +568,7 @@ func checkEnvVars(ctx context.Context, cfg *Configuration) { } if cfg.APIUI.KeyType == "" { - log.Info(ctx, "ISSUER_KEY_TYPE is missing and the server set up it as BJJ") + log.Info(ctx, "ISSUER_API_UI_KEY_TYPE is missing and the server set up it as BJJ") cfg.APIUI.KeyType = "BJJ" }