forked from eclipse-edc/DataDashboard
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
122 additional connector self-description (#165)
* fix contract policy created message * feat EDC_UI_CONFIG_URL * feat more connector self-description properties * chore update CHANGELOG.md
- Loading branch information
1 parent
963208c
commit 39dec8b
Showing
52 changed files
with
848 additions
and
412 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,21 @@ | ||
# .env file configured for default npm run start commands | ||
# see app-config-properties.ts for list of all configurable values | ||
EDC_UI_ACTIVE_PROFILE=sovity-open-source | ||
|
||
EDC_UI_DATA_MANAGEMENT_API_URL=http://localhost:3000/api/v1/data | ||
EDC_UI_DATA_MANAGEMENT_API_KEY=no-api-key-required-in-local-dev | ||
EDC_UI_CATALOG_URLS=http://existing-other-connector/v1/ids/data,http://does-not-exist-but-is-super-long-so-we-can-test/v1/ids/data, http://how-wrapping-works-in-subtext-of-catalog-url-select/v1/ids/data | ||
EDC_UI_LOGOUT_URL=https://google.com | ||
EDC_UI_ASSET_PROP_ORIGINATOR=http://localhost:3000/v1/ids/data | ||
EDC_UI_ASSET_PROP_ORIGINATOR_ORGANIZATION=Example GmbH | ||
EDC_UI_LOGOUT_URL=https://example.com/logout | ||
EDC_UI_CONNECTOR_ENDPOINT=http://localhost:3000/v1/ids/data | ||
|
||
EDC_UI_CONNECTOR_ID=https://example-connector-id/ | ||
EDC_UI_CONNECTOR_NAME=example-connector-name | ||
EDC_UI_IDS_ID=urn:connector:example | ||
EDC_UI_IDS_TITLE=Example Connector Title | ||
EDC_UI_IDS_DESCRIPTION=This is an example EDC UI in local dev. | ||
EDC_UI_CURATOR_URL=https://example.com | ||
EDC_UI_CURATOR_ORGANIZATION_NAME=Example GmbH | ||
EDC_UI_DAPS_OAUTH_TOKEN_URL=https://example-daps.com/token | ||
EDC_UI_DAPS_OAUTH_JWKS_URL=https://example-daps.com/jwks.json | ||
EDC_UI_MAINTAINER_URL=https://example.com | ||
EDC_UI_MAINTAINER_ORGANIZATION_NAME=Example GmbH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,79 @@ | ||
import {Injectable} from '@angular/core'; | ||
import {AppConfig} from './app-config'; | ||
import {AppConfigProperties} from './app-config-properties'; | ||
import {EDC_UI_PROFILE_DATA, getProfileOrFallback} from './edc-ui-profile'; | ||
import {getProfileOrFallback} from './profiles/get-profile-or-fallback'; | ||
|
||
@Injectable() | ||
export class AppConfigBuilder { | ||
/** | ||
* Build {@link AppConfig} from ENV Vars | ||
* | ||
* @param envVars env vars | ||
* @param vars env vars | ||
*/ | ||
buildAppConfig(envVars: Record<string, string | null>): AppConfig { | ||
const vars = { | ||
...JSON.parse(envVars[AppConfigProperties.configJson] || '{}'), | ||
...envVars, | ||
}; | ||
buildAppConfig(vars: Record<string, string | null>): AppConfig { | ||
|
||
const profile = getProfileOrFallback( | ||
const {profile, profileConfig} = getProfileOrFallback( | ||
vars[AppConfigProperties.activeProfile], | ||
); | ||
|
||
return { | ||
// profile and theme | ||
profile, | ||
...EDC_UI_PROFILE_DATA[profile], | ||
...profileConfig, | ||
|
||
// EDC Backend Endpoints | ||
connectorEndpoint: | ||
vars[AppConfigProperties.connectorEndpoint] ?? | ||
vars[AppConfigProperties._legacyConnectorEndpoint] ?? | ||
'https://no-connector-endpoint-configured', | ||
dataManagementApiKey: | ||
vars[AppConfigProperties.dataManagementApiKey] ?? | ||
'no-api-key-configured', | ||
dataManagementApiUrl: | ||
vars[AppConfigProperties.dataManagementApiUrl] ?? | ||
'https://no-backend-api-url-configured', | ||
originator: | ||
vars[AppConfigProperties.originator] ?? | ||
'https://no-originator-configured', | ||
originatorOrganization: | ||
vars[AppConfigProperties.originatorOrganization] ?? | ||
'No Originator Organization Configured', | ||
catalogUrl: vars[AppConfigProperties.catalogUrls] ?? '', | ||
logoutUrl: | ||
vars[AppConfigProperties.logoutUrl] ?? | ||
'https://no-logout-url-configured', | ||
|
||
// Other EDC Backend Endpoints | ||
catalogUrls: vars[AppConfigProperties.catalogUrls] ?? '', | ||
|
||
// Connector Self-Description | ||
connectorId: | ||
vars[AppConfigProperties.connectorId] ?? | ||
'https://missing-edc-connector-id', | ||
connectorName: | ||
vars[AppConfigProperties.connectorName] ?? | ||
'EDC Connector (No Name Configured)', | ||
connectorIdsId: | ||
vars[AppConfigProperties.connectorIdsId] ?? | ||
'no-ids-connector-id-configured', | ||
connectorIdsTitle: | ||
vars[AppConfigProperties.connectorIdsTitle] ?? | ||
'EDC Connector (No Title Configured)', | ||
connectorIdsDescription: | ||
vars[AppConfigProperties.connectorIdsDescription] ?? | ||
'No Connector Description was configured.', | ||
curatorUrl: | ||
vars[AppConfigProperties.curatorUrl] ?? | ||
'http://no-curator-url-configured', | ||
curatorOrganizationName: | ||
vars[AppConfigProperties.curatorOrganizationName] ?? | ||
vars[AppConfigProperties._legacyCuratorOrganizationName] ?? | ||
'No Curator Organization Name Configured', | ||
dapsOauthTokenUrl: | ||
vars[AppConfigProperties.dapsOauthTokenUrl] ?? | ||
'http://no-daps-oauth-token-url-configured', | ||
dapsOauthJwksUrl: | ||
vars[AppConfigProperties.dapsOauthJwksUrl] ?? | ||
'http://no-daps-oauth-jwks-url-configured', | ||
maintainerUrl: | ||
vars[AppConfigProperties.maintainerUrl] ?? | ||
'http://no-maintainer-url-configured', | ||
maintainerOrganizationName: | ||
vars[AppConfigProperties.maintainerOrganizationName] ?? | ||
'No Maintainer Organization Name Configured', | ||
}; | ||
} | ||
} |
Oops, something went wrong.