mirror of
https://github.com/datahub-project/datahub.git
synced 2025-10-27 08:54:32 +00:00
Merge pull request #1376 from cptran777/update-jitacl-contact-and-getconfig
Add jitacl contact to configs update getconfigs to take default value
This commit is contained in:
commit
a1ade0a867
@ -92,6 +92,9 @@ public class Application extends Controller {
|
|||||||
private static final String WHZ_WIKI_LINKS__EXPORT_POLICY =
|
private static final String WHZ_WIKI_LINKS__EXPORT_POLICY =
|
||||||
Play.application().configuration().getString("links.wiki.exportPolicy", "");
|
Play.application().configuration().getString("links.wiki.exportPolicy", "");
|
||||||
|
|
||||||
|
private static final String WHZ_LINKS__JIT_ACL_CONTACT =
|
||||||
|
Play.application().configuration().getString("links.jitAcl.contact", "");
|
||||||
|
|
||||||
private static final String DB_WHEREHOWS_URL =
|
private static final String DB_WHEREHOWS_URL =
|
||||||
Play.application().configuration().getString("database.opensource.url");
|
Play.application().configuration().getString("database.opensource.url");
|
||||||
private static final String WHZ_DB_DSCLASSNAME =
|
private static final String WHZ_DB_DSCLASSNAME =
|
||||||
@ -209,6 +212,7 @@ public class Application extends Controller {
|
|||||||
config.put("suggestionConfidenceThreshold", Integer.parseInt(WHZ_SUGGESTION_CONFIDENCE_THRESHOLD));
|
config.put("suggestionConfidenceThreshold", Integer.parseInt(WHZ_SUGGESTION_CONFIDENCE_THRESHOLD));
|
||||||
config.set("wikiLinks", wikiLinks());
|
config.set("wikiLinks", wikiLinks());
|
||||||
config.set("JitAclAccessWhitelist", Json.toJson(StringUtils.split(JIT_ACL_WHITELIST, ',')));
|
config.set("JitAclAccessWhitelist", Json.toJson(StringUtils.split(JIT_ACL_WHITELIST, ',')));
|
||||||
|
config.put("jitAclContact", WHZ_LINKS__JIT_ACL_CONTACT);
|
||||||
config.set("tracking", trackingInfo());
|
config.set("tracking", trackingInfo());
|
||||||
// In a staging environment, we can trigger this flag to be true so that the UI can handle based on
|
// In a staging environment, we can trigger this flag to be true so that the UI can handle based on
|
||||||
// such config and alert users that their changes will not affect production data
|
// such config and alert users that their changes will not affect production data
|
||||||
|
|||||||
@ -76,6 +76,11 @@ export default class DatasetAclAccessContainer extends Component {
|
|||||||
*/
|
*/
|
||||||
isJitAclAccessEnabled: boolean;
|
isJitAclAccessEnabled: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Who to contact in case of error
|
||||||
|
*/
|
||||||
|
jitAclContact: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Request object for the current user requesting access control
|
* Request object for the current user requesting access control
|
||||||
* @type {IRequestAccessControlEntry}
|
* @type {IRequestAccessControlEntry}
|
||||||
@ -170,7 +175,9 @@ export default class DatasetAclAccessContainer extends Component {
|
|||||||
|
|
||||||
notify(NotificationEvent.confirm, {
|
notify(NotificationEvent.confirm, {
|
||||||
header: 'Successfully processed ACL request',
|
header: 'Successfully processed ACL request',
|
||||||
content: `${message} Your access should be enabled within 15 minutes. Contact ask_acl@linkedin.com if you're still having issues after that time.`,
|
content: `${message} Your access should be enabled within 15 minutes. Contact ${
|
||||||
|
this.jitAclContact
|
||||||
|
} if you're still having issues after that time.`,
|
||||||
dialogActions,
|
dialogActions,
|
||||||
confirmButtonText: false,
|
confirmButtonText: false,
|
||||||
dismissButtonText: 'Dismiss'
|
dismissButtonText: 'Dismiss'
|
||||||
|
|||||||
@ -60,6 +60,13 @@ export default class DatasetController extends Controller {
|
|||||||
*/
|
*/
|
||||||
jitAclAccessWhitelist: Array<DatasetPlatform>;
|
jitAclAccessWhitelist: Array<DatasetPlatform>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* String to indicate who to contact for acl issues
|
||||||
|
* @type {string}
|
||||||
|
* @memberof DatasetController
|
||||||
|
*/
|
||||||
|
jitAclContact: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* References the collection of help links with references to external pages of help information
|
* References the collection of help links with references to external pages of help information
|
||||||
* @type {Record<string, string>}
|
* @type {Record<string, string>}
|
||||||
|
|||||||
@ -95,6 +95,7 @@ export default class DatasetRoute extends Route {
|
|||||||
setProperties(controller, {
|
setProperties(controller, {
|
||||||
isInternal: !!getConfig('isInternal'),
|
isInternal: !!getConfig('isInternal'),
|
||||||
jitAclAccessWhitelist: getConfig('JitAclAccessWhitelist') || [],
|
jitAclAccessWhitelist: getConfig('JitAclAccessWhitelist') || [],
|
||||||
|
jitAclContact: getConfig('jitAclContact', { useDefault: true, default: 'your ACL admin' }),
|
||||||
shouldShowDatasetLineage: getConfig('shouldShowDatasetLineage'),
|
shouldShowDatasetLineage: getConfig('shouldShowDatasetLineage'),
|
||||||
shouldShowDatasetHealth: getConfig('shouldShowDatasetHealth'),
|
shouldShowDatasetHealth: getConfig('shouldShowDatasetHealth'),
|
||||||
wikiLinks: getConfig('wikiLinks')
|
wikiLinks: getConfig('wikiLinks')
|
||||||
|
|||||||
@ -51,15 +51,21 @@ export default class Configurator extends Service {
|
|||||||
* @static
|
* @static
|
||||||
* @template K
|
* @template K
|
||||||
* @param {K} [key] if provided, the value is returned with that key on the config hash is returned
|
* @param {K} [key] if provided, the value is returned with that key on the config hash is returned
|
||||||
|
* @param {IAppConfigOrProperty<K>} [defaultValue] if provided, will default if key is not found in config
|
||||||
* @returns {IAppConfigOrProperty<K>}
|
* @returns {IAppConfigOrProperty<K>}
|
||||||
* @memberof Configurator
|
* @memberof Configurator
|
||||||
*/
|
*/
|
||||||
static getConfig<K extends keyof IAppConfig | undefined>(key?: K): IAppConfigOrProperty<K> {
|
static getConfig<K extends keyof IAppConfig | undefined>(
|
||||||
|
key?: K,
|
||||||
|
options: { useDefault?: boolean; default?: IAppConfigOrProperty<K> } = {}
|
||||||
|
): IAppConfigOrProperty<K> {
|
||||||
// Ensure that the application configuration has been successfully cached
|
// Ensure that the application configuration has been successfully cached
|
||||||
assert('Please ensure you have invoked the `load` method successfully prior to calling `getConfig`.', configLoaded);
|
assert('Please ensure you have invoked the `load` method successfully prior to calling `getConfig`.', configLoaded);
|
||||||
|
|
||||||
return typeof key === 'string' && appConfig.hasOwnProperty(<keyof IAppConfig>key)
|
return typeof key === 'string' && appConfig.hasOwnProperty(<keyof IAppConfig>key)
|
||||||
? <IAppConfigOrProperty<K>>deepClone(appConfig[<keyof IAppConfig>key])
|
? <IAppConfigOrProperty<K>>deepClone(appConfig[<keyof IAppConfig>key])
|
||||||
: <IAppConfigOrProperty<K>>deepClone(appConfig);
|
: options.useDefault
|
||||||
|
? <IAppConfigOrProperty<K>>options.default
|
||||||
|
: <IAppConfigOrProperty<K>>deepClone(appConfig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -217,7 +217,7 @@
|
|||||||
|
|
||||||
{{empty-state
|
{{empty-state
|
||||||
heading="There are no users in this dataset's ACL"
|
heading="There are no users in this dataset's ACL"
|
||||||
subHead="If you feel this is in error, please contact ask_acl@linkedin.com"
|
subHead=(concat "If you feel this is in error, please contact " jitAclContact)
|
||||||
}}
|
}}
|
||||||
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|||||||
@ -8,6 +8,7 @@
|
|||||||
{{dataset-aclaccess
|
{{dataset-aclaccess
|
||||||
acls=acls
|
acls=acls
|
||||||
aclMoreInfoLink=@aclMoreInfoLink
|
aclMoreInfoLink=@aclMoreInfoLink
|
||||||
|
jitAclContact=jitAclContact
|
||||||
hasValidAclRequest=hasValidAclRequest
|
hasValidAclRequest=hasValidAclRequest
|
||||||
userAclRequest=userAclRequest
|
userAclRequest=userAclRequest
|
||||||
userHasAclAccess=userHasAclAccess
|
userHasAclAccess=userHasAclAccess
|
||||||
|
|||||||
@ -164,6 +164,7 @@
|
|||||||
urn=encodedUrn
|
urn=encodedUrn
|
||||||
aclMoreInfoLink=wikiLinks.jitAcl
|
aclMoreInfoLink=wikiLinks.jitAcl
|
||||||
isJitAclAccessEnabled=isJitAclAccessEnabled
|
isJitAclAccessEnabled=isJitAclAccessEnabled
|
||||||
|
jitAclContact=jitAclContact
|
||||||
}}
|
}}
|
||||||
{{/tabs.tabpanel}}
|
{{/tabs.tabpanel}}
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import { DatasetPlatform } from 'wherehows-web/constants';
|
|||||||
interface IAppConfig {
|
interface IAppConfig {
|
||||||
isInternal: boolean | void;
|
isInternal: boolean | void;
|
||||||
JitAclAccessWhitelist: Array<DatasetPlatform> | void;
|
JitAclAccessWhitelist: Array<DatasetPlatform> | void;
|
||||||
|
jitAclContact: string;
|
||||||
shouldShowDatasetLineage: boolean;
|
shouldShowDatasetLineage: boolean;
|
||||||
shouldShowDatasetHealth: boolean;
|
shouldShowDatasetHealth: boolean;
|
||||||
// confidence threshold for filtering out higher quality suggestions
|
// confidence threshold for filtering out higher quality suggestions
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user