Skip to content

Commit

Permalink
[Fleet] Enable package signature verification feature (#137239)
Browse files Browse the repository at this point in the history
* [Fleet] Enable package verification feature

* handle cases where verification_key_id is set to null
  • Loading branch information
hop-dev authored Jul 26, 2022
1 parent f903899 commit fc55587
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion x-pack/plugins/fleet/common/experimental_features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type ExperimentalFeatures = typeof allowedExperimentalValues;
*/
export const allowedExperimentalValues = Object.freeze({
createPackagePolicyMultiPageLayout: true,
packageVerification: false,
packageVerification: true,
});

type ExperimentalConfigKeys = Array<keyof ExperimentalFeatures>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,12 @@ const expectAssetsInstalled = ({
// during a reinstall the items can change
const sortedRes = {
...res.attributes,
// verification_key_id can be null or undefined for install or reinstall cases,
// kbn/expect only does strict equality so undefined is normalised to null
verification_key_id:
res.attributes.verification_key_id === undefined
? null
: res.attributes.verification_key_id,
installed_kibana: sortBy(res.attributes.installed_kibana, (o: AssetReference) => o.type),
installed_es: sortBy(res.attributes.installed_es, (o: AssetReference) => o.type),
package_assets: sortBy(res.attributes.package_assets, (o: AssetReference) => o.type),
Expand Down Expand Up @@ -768,6 +774,7 @@ const expectAssetsInstalled = ({
install_source: 'registry',
install_format_schema_version: FLEET_INSTALL_FORMAT_VERSION,
verification_status: 'unknown',
verification_key_id: null,
});
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ export default function (providerContext: FtrProviderContext) {
install_source: 'registry',
install_format_schema_version: FLEET_INSTALL_FORMAT_VERSION,
verification_status: 'unknown',
verification_key_id: null,
});
});
});
Expand Down

0 comments on commit fc55587

Please sign in to comment.