Skip to content

Commit 2fa8d17

Browse files
Merge pull request #13207 from linode/staging
Release v1.156.1 - `staging` → `master`
2 parents af118d3 + de81051 commit 2fa8d17

File tree

14 files changed

+147
-65
lines changed

14 files changed

+147
-65
lines changed

packages/api-v4/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [2025-12-16] - v0.154.1
2+
3+
4+
### Added:
5+
6+
- `Akamai Cloud Pulse Logs LKE-E Audit` to the `AccountCapability` type ([#13171](https://github.com/linode/manager/pull/13171))
7+
18
## [2025-12-09] - v0.154.0
29

310

packages/api-v4/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@linode/api-v4",
3-
"version": "0.154.0",
3+
"version": "0.154.1",
44
"homepage": "https://github.com/linode/manager/tree/develop/packages/api-v4",
55
"bugs": {
66
"url": "https://github.com/linode/manager/issues"

packages/api-v4/src/account/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export const accountCapabilities = [
6363
'Akamai Cloud Load Balancer',
6464
'Akamai Cloud Pulse',
6565
'Akamai Cloud Pulse Logs',
66+
'Akamai Cloud Pulse Logs LKE-E Audit',
6667
'Block Storage',
6768
'Block Storage Encryption',
6869
'Cloud Firewall',

packages/manager/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [2025-12-16] - v1.156.1
8+
9+
10+
### Changed:
11+
12+
- Logs: in Stream Form limit access to "lke_audit_logs" type based on Akamai Cloud Pulse Logs LKE-E Audit capability ([#13171](https://github.com/linode/manager/pull/13171))
13+
14+
### Fixed:
15+
16+
- IAM: Inability for restricted users to update own username in their profile ([#13198](https://github.com/linode/manager/pull/13198))
17+
- IAM: Remove Role filter (already assigned roles) in ChangeRoleForEntityDrawer ([#13201](https://github.com/linode/manager/pull/13201))
18+
719
## [2025-12-09] - v1.156.0
820

921

packages/manager/cypress/e2e/core/delivery/create-stream.spec.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { streamType } from '@linode/api-v4';
22
import { mockDestination } from 'support/constants/delivery';
3+
import { mockGetAccount } from 'support/intercepts/account';
34
import {
45
mockCreateDestination,
56
mockCreateStream,
@@ -12,9 +13,11 @@ import { ui } from 'support/ui';
1213
import { logsStreamForm } from 'support/ui/pages/logs-stream-form';
1314
import { randomLabel } from 'support/util/random';
1415

15-
import { kubernetesClusterFactory } from 'src/factories';
16+
import { accountFactory, kubernetesClusterFactory } from 'src/factories';
1617

1718
describe('Create Stream', () => {
19+
const account = accountFactory.build();
20+
1821
beforeEach(() => {
1922
mockAppendFeatureFlags({
2023
aclpLogs: {
@@ -23,6 +26,14 @@ describe('Create Stream', () => {
2326
bypassAccountCapabilities: true,
2427
},
2528
});
29+
30+
mockGetAccount({
31+
...account,
32+
capabilities: [
33+
...account.capabilities,
34+
'Akamai Cloud Pulse Logs LKE-E Audit',
35+
],
36+
});
2637
});
2738

2839
describe('given Audit Logs Stream Type', () => {

packages/manager/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "linode-manager",
33
"author": "Linode",
44
"description": "The Linode Manager website",
5-
"version": "1.156.0",
5+
"version": "1.156.1",
66
"private": true,
77
"type": "module",
88
"bugs": {

packages/manager/src/features/Delivery/Streams/StreamForm/StreamFormGeneralInfo.test.tsx

Lines changed: 76 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,23 @@ import userEvent from '@testing-library/user-event';
44
import React from 'react';
55
import { describe, expect } from 'vitest';
66

7+
import { accountFactory } from 'src/factories';
78
import { renderWithThemeAndHookFormContext } from 'src/utilities/testHelpers';
89

910
import { StreamFormGeneralInfo } from './StreamFormGeneralInfo';
1011

12+
const queryMocks = vi.hoisted(() => ({
13+
useAccount: vi.fn().mockReturnValue({}),
14+
}));
15+
16+
vi.mock('@linode/queries', async () => {
17+
const actual = await vi.importActual('@linode/queries');
18+
return {
19+
...actual,
20+
useAccount: queryMocks.useAccount,
21+
};
22+
});
23+
1124
describe('StreamFormGeneralInfo', () => {
1225
describe('when in create mode', () => {
1326
it('should render Name input and allow to type text', async () => {
@@ -24,35 +37,77 @@ describe('StreamFormGeneralInfo', () => {
2437
});
2538
});
2639

27-
it('should render Stream type input and allow to select different options', async () => {
28-
renderWithThemeAndHookFormContext({
29-
component: <StreamFormGeneralInfo mode="create" />,
30-
useFormOptions: {
31-
defaultValues: {
32-
stream: {
33-
type: streamType.AuditLogs,
40+
describe('when user has Akamai Cloud Pulse Logs LKE-E Audit capability', () => {
41+
it('should render Stream type input and allow to select different options', async () => {
42+
const account = accountFactory.build({
43+
capabilities: ['Akamai Cloud Pulse Logs LKE-E Audit'],
44+
});
45+
46+
queryMocks.useAccount.mockReturnValue({
47+
data: account,
48+
isLoading: false,
49+
error: null,
50+
});
51+
52+
renderWithThemeAndHookFormContext({
53+
component: <StreamFormGeneralInfo mode="create" />,
54+
useFormOptions: {
55+
defaultValues: {
56+
stream: {
57+
type: streamType.AuditLogs,
58+
},
3459
},
3560
},
36-
},
37-
});
61+
});
3862

39-
const streamTypesAutocomplete = screen.getByRole('combobox');
63+
const streamTypesAutocomplete = screen.getByRole('combobox');
4064

41-
expect(streamTypesAutocomplete).toHaveValue('Audit Logs');
42-
43-
// Open the dropdown
44-
await userEvent.click(streamTypesAutocomplete);
65+
expect(streamTypesAutocomplete).toHaveValue('Audit Logs');
4566

46-
// Select the "Kubernetes API Audit Logs" option
47-
const kubernetesApiAuditLogs = await screen.findByText(
48-
'Kubernetes API Audit Logs'
49-
);
50-
await userEvent.click(kubernetesApiAuditLogs);
67+
// Open the dropdown
68+
await userEvent.click(streamTypesAutocomplete);
5169

52-
await waitFor(() => {
53-
expect(streamTypesAutocomplete).toHaveValue(
70+
// Select the "Kubernetes API Audit Logs" option
71+
const kubernetesApiAuditLogs = await screen.findByText(
5472
'Kubernetes API Audit Logs'
5573
);
74+
await userEvent.click(kubernetesApiAuditLogs);
75+
76+
await waitFor(() => {
77+
expect(streamTypesAutocomplete).toHaveValue(
78+
'Kubernetes API Audit Logs'
79+
);
80+
});
81+
});
82+
});
83+
84+
describe('when user does not have Akamai Cloud Pulse Logs LKE-E Audit capability', () => {
85+
it('should render disabled Stream type input with Audit Logs selected', async () => {
86+
const account = accountFactory.build({
87+
capabilities: [],
88+
});
89+
90+
queryMocks.useAccount.mockReturnValue({
91+
data: account,
92+
isLoading: false,
93+
error: null,
94+
});
95+
96+
renderWithThemeAndHookFormContext({
97+
component: <StreamFormGeneralInfo mode="create" />,
98+
useFormOptions: {
99+
defaultValues: {
100+
stream: {
101+
type: streamType.AuditLogs,
102+
},
103+
},
104+
},
105+
});
106+
107+
const streamTypesAutocomplete = screen.getByRole('combobox');
108+
109+
expect(streamTypesAutocomplete).toBeDisabled();
110+
expect(streamTypesAutocomplete).toHaveValue('Audit Logs');
56111
});
57112
});
58113
});

packages/manager/src/features/Delivery/Streams/StreamForm/StreamFormGeneralInfo.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { streamType } from '@linode/api-v4';
2+
import { useAccount } from '@linode/queries';
23
import {
34
Autocomplete,
45
Box,
@@ -35,6 +36,10 @@ export const StreamFormGeneralInfo = (props: StreamFormGeneralInfoProps) => {
3536

3637
const theme = useTheme();
3738
const { control, setValue } = useFormContext<StreamAndDestinationFormType>();
39+
const { data: account } = useAccount();
40+
const isLkeEAuditLogsTypeSelectionDisabled = !account?.capabilities?.includes(
41+
'Akamai Cloud Pulse Logs LKE-E Audit'
42+
);
3843

3944
const capitalizedMode = capitalize(mode);
4045
const description = {
@@ -47,8 +52,13 @@ export const StreamFormGeneralInfo = (props: StreamFormGeneralInfoProps) => {
4752
audit_logs: `Logs Delivery Streams ${capitalizedMode}-Audit Logs`,
4853
lke_audit_logs: `Logs Delivery Streams ${capitalizedMode}-Kubernetes Audit Logs`,
4954
};
55+
56+
const filteredStreamTypeOptions = isLkeEAuditLogsTypeSelectionDisabled
57+
? streamTypeOptions.filter(({ value }) => value !== streamType.LKEAuditLogs)
58+
: streamTypeOptions;
59+
5060
const streamTypeOptionsWithPendo: AutocompleteOption[] =
51-
streamTypeOptions.map((option) => ({
61+
filteredStreamTypeOptions.map((option) => ({
5262
...option,
5363
pendoId: pendoIds[option.value as StreamType],
5464
}));
@@ -98,7 +108,9 @@ export const StreamFormGeneralInfo = (props: StreamFormGeneralInfoProps) => {
98108
render={({ field, fieldState }) => (
99109
<Autocomplete
100110
disableClearable
101-
disabled={isFormInEditMode(mode)}
111+
disabled={
112+
isFormInEditMode(mode) || isLkeEAuditLogsTypeSelectionDisabled
113+
}
102114
errorText={fieldState.error?.message}
103115
label="Stream Type"
104116
onBlur={field.onBlur}

packages/manager/src/features/IAM/Shared/AssignedEntitiesTable/ChangeRoleForEntityDrawer.tsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,24 +90,16 @@ export const ChangeRoleForEntityDrawer = ({
9090
el.access === role?.access &&
9191
el.value !== role?.role_name;
9292

93-
// Exclude account roles already assigned to the user
9493
if (isAccountRole(el)) {
95-
return (
96-
!assignedRoles?.account_access.includes(el.value) &&
97-
matchesRoleContext
98-
);
94+
return matchesRoleContext;
9995
}
100-
// Exclude entity roles already assigned to the user
96+
10197
if (isEntityRole(el)) {
102-
return (
103-
!assignedRoles?.entity_access.some((entity) =>
104-
entity.roles.includes(el.value)
105-
) && matchesRoleContext
106-
);
98+
return matchesRoleContext;
10799
}
108100
return true;
109101
});
110-
}, [accountRoles, role, assignedRoles]);
102+
}, [accountRoles, role]);
111103

112104
const {
113105
control,

packages/manager/src/features/IAM/Users/UserDetails/UserEmailPanel.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ describe('UserEmailPanel', () => {
108108
expect(errorText).toBeInTheDocument();
109109
});
110110

111-
it('disables the save button when the user does not have update_user permission', async () => {
111+
it('disables the save button when the user does not have is_account_admin permission', async () => {
112112
const user = accountUserFactory.build({
113113
email: 'my-linode-email',
114114
});

0 commit comments

Comments
 (0)