Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INJIMOB-2452]: Updating attribute name from credential_issuer to issuer_id #222

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions docker-compose/config/mimoto-issuers-config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"issuers": [
{
"credential_issuer": "Mosip",
"issuer_id": "Mosip",
"protocol": "OpenId4VCI",
"display": [
{
Expand Down Expand Up @@ -72,11 +72,13 @@
"proxy_token_endpoint": "https://esignet-mosipid.collab.mosip.net/v1/esignet/oauth/v2/token",
"client_alias": "mpartner-default-test-mosipid",
"qr_code_type": "OnlineSharing",
"enabled": "true",
"wellknown_endpoint": "https://injicertify-mosipid.collab.mosip.net/v1/certify/issuance/.well-known/openid-credential-issuer"
"wellknown_endpoint": "https://injicertify-mosipid.collab.mosip.net/v1/certify/issuance/.well-known/openid-credential-issuer",
"credential_issuer": "https://injicertify-mosipid.collab.mosip.net",
"enabled": "true"

},
{
"credential_issuer": "StayProtected",
"issuer_id": "StayProtected",
"protocol": "OpenId4VCI",
"display": [
{
Expand All @@ -97,11 +99,12 @@
"proxy_token_endpoint": "https://esignet-insurance.dev1.mosip.net/v1/esignet/oauth/v2/token",
"client_alias": "esignet-sunbird-partner",
"qr_code_type": "OnlineSharing",
"enabled": "true",
"wellknown_endpoint": "https://injicertify-insurance.dev1.mosip.net/v1/certify/issuance/.well-known/openid-credential-issuer"
"wellknown_endpoint": "https://injicertify-insurance.dev1.mosip.net/v1/certify/issuance/.well-known/openid-credential-issuer",
"credential_issuer": "https://injicertify-insurance.dev1.mosip.net",
"enabled": "true"
},
{
"credential_issuer": "Mock",
"issuer_id": "Mock",
"protocol": "OpenId4VCI",
"display": [
{
Expand All @@ -122,8 +125,9 @@
"proxy_token_endpoint": "https://esignet-mock.collab.mosip.net/v1/esignet/oauth/v2/token",
"client_alias": "mpartner-mock-testing",
"qr_code_type": "OnlineSharing",
"enabled": "true",
"wellknown_endpoint": "https://injicertify-mock.collab.mosip.net/v1/certify/issuance/.well-known/openid-credential-issuer"
"wellknown_endpoint": "https://injicertify-mock.collab.mosip.net/v1/certify/issuance/.well-known/openid-credential-issuer",
"credential_issuer": "https://injicertify-mock.collab.mosip.net",
"enabled": "true"
}
]
}
4 changes: 2 additions & 2 deletions inji-web/src/__tests__/pages/RedirectionPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('Testing the Layout of RedirectionPage', () => {
mockUseFetch();
test('Check if the layout is matching with the snapshots', () => {
mockUseFetchhook.mockReturnValue({ state: 'DONE', fetchRequest: jest.fn() });
(getActiveSession as jest.Mock).mockReturnValue({ selectedIssuer: { credential_issuer: 'issuer1', display: [{ name: 'Test Issuer' }] } });
(getActiveSession as jest.Mock).mockReturnValue({ selectedIssuer: { issuer_id: 'issuer1', display: [{ name: 'Test Issuer' }] } });
const { asFragment } = renderWithRouter(<RedirectionPage />);
expect(asFragment()).toMatchSnapshot();
});
Expand All @@ -33,7 +33,7 @@ describe('Testing the Functionality of RedirectionPage', () => {
mockusei18n();
mockUseFetch();
jest.clearAllMocks();
(getActiveSession as jest.Mock).mockReturnValue({ selectedIssuer: { credential_issuer: 'issuer1', display: [{ name: 'Test Issuer' }] } });
(getActiveSession as jest.Mock).mockReturnValue({ selectedIssuer: { issuer_id: 'issuer1', display: [{ name: 'Test Issuer' }] } });
});

test('Check if NavBar component is rendered', () => {
Expand Down
2 changes: 1 addition & 1 deletion inji-web/src/__tests__/utils/api.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe('Testing API Class', () => {
name: 'Issuer Name',
desc: 'Issuer Description',
protocol: 'OpenId4VCI',
credential_issuer: 'issuer123',
issuer_id: 'issuer123',
authorization_endpoint: 'http://auth.server/authorize',
credentials_endpoint: 'http://credentials.endpoint',
display: [
Expand Down
2 changes: 1 addition & 1 deletion inji-web/src/components/Issuers/Issuer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const Issuer: React.FC<IssuerProps> = ({issuer, index}) => {
url={issuerDisplayObject?.logo.url}
title={issuerDisplayObject?.name}
description={issuerDisplayObject?.description}
onClick={() => navigate(`/issuers/${issuer.credential_issuer}`)}/>
onClick={() => navigate(`/issuers/${issuer.issuer_id}`)}/>
</React.Fragment>
}

4 changes: 2 additions & 2 deletions inji-web/src/pages/RedirectionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const RedirectionPage: React.FC = () => {
const code = searchParams.get("code") ?? "";
const urlState = searchParams.get("state") ?? "";
const codeVerifier = activeSessionInfo?.codeVerifier;
const issuerId = activeSessionInfo?.selectedIssuer?.credential_issuer ?? "";
const issuerId = activeSessionInfo?.selectedIssuer?.issuer_id ?? "";
const certificateId = activeSessionInfo?.certificateId;
const vcStorageExpiryLimitInTimes = activeSessionInfo?.vcStorageExpiryLimitInTimes ?? "-1";

Expand Down Expand Up @@ -87,7 +87,7 @@ export const RedirectionPage: React.FC = () => {
}

return <div data-testid="Redirection-Page-Container">
{activeSessionInfo?.selectedIssuer?.credential_issuer && <NavBar title={displayObject?.name ?? ""} search={false} link={`/issuers/${activeSessionInfo?.selectedIssuer?.credential_issuer}`}/>}
{activeSessionInfo?.selectedIssuer?.issuer_id && <NavBar title={displayObject?.name ?? ""} search={false} link={`/issuers/${activeSessionInfo?.selectedIssuer?.issuer_id}`}/>}
{loadStatusOfRedirection()}
</div>
}
6 changes: 3 additions & 3 deletions inji-web/src/test-utils/mockObjects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const mockIssuerObject = {
name: 'Test Issuer',
desc: 'Test Description',
protocol: 'OTP' as 'OTP', // Explicitly set the type to 'OTP' or 'OpenId4VCI'
credential_issuer: 'test-issuer',
issuer_id: 'test-issuer',
authorization_endpoint: 'https://auth.test.com',
credentials_endpoint: 'https://credentials.test.com',
display: [{
Expand Down Expand Up @@ -154,7 +154,7 @@ export const mockIssuerObjectList = [
name: 'Issuer 1',
desc: 'Description 1',
protocol: 'OpenId4VCI',
credential_issuer: 'issuer1',
issuer_id: 'issuer1',
authorization_endpoint: 'https://issuer1.com/auth',
credentials_endpoint: 'https://issuer1.com/credentials',
display: [
Expand All @@ -179,7 +179,7 @@ export const mockIssuerObjectList = [
name: 'Issuer 2',
desc: 'Description 2',
protocol: 'OpenId4VCI',
credential_issuer: 'issuer2',
issuer_id: 'issuer2',
authorization_endpoint: 'https://issuer2.com/auth',
credentials_endpoint: 'https://issuer2.com/credentials',
display: [
Expand Down
2 changes: 1 addition & 1 deletion inji-web/src/types/data.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export type IssuerObject = {
name: string;
desc: string;
protocol: 'OTP' | 'OpenId4VCI';
credential_issuer: string,
issuer_id: string,
authorization_endpoint: string;
credentials_endpoint: string;
display: DisplayArrayObject[];
Expand Down
Loading