Skip to content

Commit

Permalink
Merge branch 'main' into 174144-rename-to-discover-session
Browse files Browse the repository at this point in the history
  • Loading branch information
jughosta authored Dec 16, 2024
2 parents a8366fb + c92899e commit 3bf0a38
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ export class KibanaFramework {
config: InfraRouteConfig<Params, Query, Body, Method>,
handler: RequestHandler<Params, Query, Body, InfraPluginRequestHandlerContext>
) {
const defaultOptions = {
tags: ['access:infra'],
};
const defaultSecurity = { authz: { requiredPrivileges: ['infra'] } };

const routeConfig = {
path: config.path,
validate: config.validate,
Expand All @@ -65,7 +64,8 @@ export class KibanaFramework {
* using `as ...` below to ensure the route config has
* the correct options type.
*/
options: { ...config.options, ...defaultOptions },
options: { ...config.options },
security: defaultSecurity,
};
switch (config.method) {
case 'get':
Expand All @@ -89,15 +89,12 @@ export class KibanaFramework {
public registerVersionedRoute<Method extends RouteMethod = any>(
config: InfraVersionedRouteConfig<Method>
) {
const defaultOptions = {
tags: ['access:infra'],
};
const defaultSecurity = { authz: { requiredPrivileges: ['infra'] } };

const routeConfig = {
access: config.access,
path: config.path,
// Currently we have no use of custom options beyond tags, this can be extended
// beyond defaultOptions if it's needed.
options: defaultOptions,
security: defaultSecurity,
};
switch (config.method) {
case 'get':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const ExpandableSection = ({ title, isOpen, toggle, children }: ExpandableSectio
};

interface RuleOverviewTabProps {
rule: RuleResponse;
rule: Partial<RuleResponse>;
columnWidths?: EuiDescriptionListProps['columnWidths'];
expandedOverviewSections: Record<keyof typeof defaultOverviewOpenSections, boolean>;
toggleOverviewSection: Record<keyof typeof defaultOverviewOpenSections, () => void>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const MigrationRuleDetailsFlyout: React.FC<MigrationRuleDetailsFlyoutProp
const ruleDetailsToOverview = useMemo(() => {
const elasticRule = ruleMigration?.elastic_rule;
if (isMigrationCustomRule(elasticRule)) {
return convertMigrationCustomRuleToSecurityRulePayload(elasticRule, false) as RuleResponse; // TODO: we need to adjust RuleOverviewTab to allow partial RuleResponse as a parameter;
return convertMigrationCustomRuleToSecurityRulePayload(elasticRule, false);
}
return matchedPrebuiltRule;
}, [ruleMigration, matchedPrebuiltRule]);
Expand Down

0 comments on commit 3bf0a38

Please sign in to comment.