kibana/x-pack/test/security_functional
Elena Shostak 7a41906d88
[Authz] Mandatory Security Config (#215180)
## Summary

This PR makes `security` a required field for route registration. To
incorporate the new required filed, changes has been made:

1. **Test file updates**. A lot of the updates made in this PR were made
in tests.
2. **Versioned route security configuration**. For the versioned route
`security` config has been lifted up to the top-level definition:

    Before
    ```ts
    router.versioned
      .get({
        path: '/api/path',
        options: { ... },
        ...
      }, handler)
      .addVersion({
         version: 1,
         validate: false,
         security: {
          authz: {
            requiredPrivileges: ['privilege'],
          },
         },
      });
    ```
    
    After
    ```ts
    router.versioned
      .get({
        path: '/api/path',
        options: { ... },
         security: {
          authz: {
            requiredPrivileges: ['privilege'],
          },
         },
        ...
      }, handler)
      .addVersion({
         version: 1,
         validate: false,
      });
    ```

3. **Type adjustments for route wrappers**. Type changes has been made
in:
-
`x-pack/solutions/observability/plugins/infra/server/lib/adapters/framework/adapter_types.ts`
-
`x-pack/solutions/observability/plugins/metrics_data_access/server/lib/adapters/framework/adapter_types.ts`
-
`x-pack/solutions/observability/plugins/synthetics/server/routes/types.ts`
-
`x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/types.ts`

Security was made an optional field for the wrappers defined in those
files, since the default security is provided in the wrapper itself and
then passed down to the core router.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)


__Closes: https://github.com/elastic/kibana/issues/215331__

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-27 12:04:53 -07:00
..
plugins/test_endpoints [Authz] Mandatory Security Config (#215180) 2025-03-27 12:04:53 -07:00
screenshots/baseline Upgrade EUI to v99.2.0-borealis.0 (#209690) 2025-02-13 10:20:46 +01:00
tests Upgrade ES client to 9.0.0-alpha.3 (#208776) 2025-02-25 14:37:23 +00:00
expired_session.config.ts [kbn-scout] add test config category to reporting (#210167) 2025-02-12 11:17:04 +01:00
ftr_provider_context.d.ts chore(security, eslint): apply platform security-specific rules to all exclusively owned paths. (#195711) 2024-10-11 09:49:12 +02:00
insecure_cluster_warning.config.ts [kbn-scout] add test config category to reporting (#210167) 2025-02-12 11:17:04 +01:00
login_selector.config.ts [kbn-scout] add test config category to reporting (#210167) 2025-02-12 11:17:04 +01:00
oidc.config.ts [kbn-scout] add test config category to reporting (#210167) 2025-02-12 11:17:04 +01:00
oidc.http2.config.ts chore(security, eslint): apply platform security-specific rules to all exclusively owned paths. (#195711) 2024-10-11 09:49:12 +02:00
saml.config.ts [kbn-scout] add test config category to reporting (#210167) 2025-02-12 11:17:04 +01:00
saml.http2.config.ts chore(security, eslint): apply platform security-specific rules to all exclusively owned paths. (#195711) 2024-10-11 09:49:12 +02:00
user_profiles.config.ts [kbn-scout] add test config category to reporting (#210167) 2025-02-12 11:17:04 +01:00