io.mosip.certify.mosipid.integration.helper.VCITransactionHelper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mosip-identity-certify-plugin Show documentation
Show all versions of mosip-identity-certify-plugin Show documentation
MOSIP-ID plugin implementation that is used for the integration with certify
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package io.mosip.certify.mosipid.integration.helper;
import io.mosip.esignet.core.dto.OIDCTransaction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.cache.CacheManager;
import org.springframework.stereotype.Component;
@Component
@ConditionalOnProperty(value = "mosip.certify.integration.vci-plugin", havingValue = "IdaVCIssuancePluginImpl")
public class VCITransactionHelper {
@Autowired
CacheManager cacheManager;
@Value("${mosip.certify.ida.vci-user-info-cache}")
private String userinfoCache;
@SuppressWarnings("unchecked")
public OIDCTransaction getOAuthTransaction(String accessTokenHash) throws Exception {
if (cacheManager.getCache(userinfoCache) != null) {
return cacheManager.getCache(userinfoCache).get(accessTokenHash, OIDCTransaction.class); //NOSONAR getCache() will not be returning null here.
}
throw new Exception("cache_missing");
}
}