Skip to content

Commit 03a26e2

Browse files
authored
Merge branch 'main' into mg/accept-header
2 parents a3c2464 + cb38688 commit 03a26e2

16 files changed

Lines changed: 183 additions & 127 deletions

File tree

.github/workflows/cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
steps:
1616
- name: Get token from Github App
1717
id: app_token
18-
uses: actions/create-github-app-token@v2.1.4
18+
uses: actions/create-github-app-token@v2.2.0
1919
with:
2020
app-id: ${{ vars.DEVOPS_GITHUB_APP_ID }}
2121
private-key: ${{ secrets.DEVOPS_GITHUB_APP_PEM }}

.github/workflows/chromatic.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
1212
steps:
1313
- name: Checkout code
14-
uses: actions/checkout@v5.0.1
14+
uses: actions/checkout@v6.0.0
1515
with:
1616
fetch-depth: 0
1717

@@ -29,7 +29,7 @@ jobs:
2929

3030
- name: Run Chromatic
3131
if: env.CHROMATIC_PROJECT_TOKEN
32-
uses: chromaui/action@v13.3.3
32+
uses: chromaui/action@v13.3.4
3333
with:
3434
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
3535
onlyChanged: true # 👈 Required option to enable TurboSnap

.github/workflows/ci.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
name: Install Dependencies
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v5.0.1
16+
- uses: actions/checkout@v6.0.0
1717
- name: Lookup node_modules cache
1818
id: node-modules-cache
1919
uses: actions/cache@v4.3.0
@@ -30,7 +30,7 @@ jobs:
3030
needs: install
3131
runs-on: ubuntu-latest
3232
steps:
33-
- uses: actions/checkout@v5.0.1
33+
- uses: actions/checkout@v6.0.0
3434
- name: Restore node_modules cache
3535
id: node-modules-cache
3636
uses: actions/cache/restore@v4.3.0
@@ -45,7 +45,7 @@ jobs:
4545
needs: install
4646
runs-on: ubuntu-latest
4747
steps:
48-
- uses: actions/checkout@v5.0.1
48+
- uses: actions/checkout@v6.0.0
4949
- name: Restore node_modules cache
5050
id: node-modules-cache
5151
uses: actions/cache/restore@v4.3.0
@@ -76,12 +76,12 @@ jobs:
7676
steps:
7777
- name: Checkout for Dependabot PR
7878
if: ${{ startsWith(github.head_ref || '', 'dependabot/') }}
79-
uses: actions/checkout@v5.0.1
79+
uses: actions/checkout@v6.0.0
8080
with:
8181
ref: ${{ github.head_ref }}
8282
- name: Checkout for others
8383
if: ${{ !startsWith(github.head_ref || '', 'dependabot/') }}
84-
uses: actions/checkout@v5.0.1
84+
uses: actions/checkout@v6.0.0
8585
- name: Restore node_modules cache
8686
id: node-modules-cache
8787
uses: actions/cache/restore@v4.3.0
@@ -124,7 +124,7 @@ jobs:
124124
needs: install
125125
runs-on: ubuntu-latest
126126
steps:
127-
- uses: actions/checkout@v5.0.1
127+
- uses: actions/checkout@v6.0.0
128128
- name: Restore node_modules cache
129129
id: node-modules-cache
130130
uses: actions/cache/restore@v4.3.0
@@ -157,7 +157,7 @@ jobs:
157157
needs: install
158158
runs-on: ubuntu-latest
159159
steps:
160-
- uses: actions/checkout@v5.0.1
160+
- uses: actions/checkout@v6.0.0
161161
- name: Restore node_modules cache
162162
id: node-modules-cache
163163
uses: actions/cache/restore@v4.3.0
@@ -198,7 +198,7 @@ jobs:
198198
needs: build
199199
runs-on: ${{ matrix.platform == 'amd64' && 'ubuntu-latest' || 'ubuntu-arm64' }}
200200
steps:
201-
- uses: actions/checkout@v5.0.1
201+
- uses: actions/checkout@v6.0.0
202202
- name: Restore build cache
203203
uses: actions/cache/restore@v4.3.0
204204
with:
@@ -209,7 +209,7 @@ jobs:
209209
uses: docker/setup-buildx-action@v3.11.1
210210
- name: Configure AWS credentials
211211
if: vars.ECR_REGION
212-
uses: aws-actions/configure-aws-credentials@v5.1.0
212+
uses: aws-actions/configure-aws-credentials@v5.1.1
213213
with:
214214
aws-access-key-id: ${{ secrets.ECR_ACCESS_KEY_ID }}
215215
aws-secret-access-key: ${{ secrets.ECR_SECRET_ACCESS_KEY }}
@@ -266,7 +266,7 @@ jobs:
266266
needs: build-images
267267
steps:
268268
- name: Configure AWS credentials
269-
uses: aws-actions/configure-aws-credentials@v5.1.0
269+
uses: aws-actions/configure-aws-credentials@v5.1.1
270270
with:
271271
aws-access-key-id: ${{ secrets.ECR_ACCESS_KEY_ID }}
272272
aws-secret-access-key: ${{ secrets.ECR_SECRET_ACCESS_KEY }}

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- name: Set up Docker Buildx
4747
uses: docker/setup-buildx-action@v3.11.1
4848
- name: Configure AWS credentials
49-
uses: aws-actions/configure-aws-credentials@v5.1.0
49+
uses: aws-actions/configure-aws-credentials@v5.1.1
5050
with:
5151
aws-access-key-id: ${{ secrets.ECR_ACCESS_KEY_ID }}
5252
aws-secret-access-key: ${{ secrets.ECR_SECRET_ACCESS_KEY }}
@@ -84,7 +84,7 @@ jobs:
8484
VERSION: ${{ needs.get-version.outputs.version }}
8585
RELEASE_DC_FILENAME: openops-dc-${{ needs.get-version.outputs.version }}.zip
8686
steps:
87-
- uses: actions/checkout@v5.0.1
87+
- uses: actions/checkout@v6.0.0
8888
- name: Create a release file
8989
run: |
9090
cp THIRD_PARTY_LICENSES.txt LICENSE NOTICE deploy/docker-compose
@@ -109,7 +109,7 @@ jobs:
109109
echo "The release was created as a draft." >> $GITHUB_STEP_SUMMARY
110110
echo "Please [review and publish it](${RELEASE_URL/\/tags\//\/edit\/})." >> $GITHUB_STEP_SUMMARY
111111
- name: Configure AWS credentials
112-
uses: aws-actions/configure-aws-credentials@v5.1.0
112+
uses: aws-actions/configure-aws-credentials@v5.1.1
113113
with:
114114
aws-access-key-id: ${{ secrets.RELEASE_S3_ACCESS_KEY_ID }}
115115
aws-secret-access-key: ${{ secrets.RELEASE_S3_SECRET_ACCESS_KEY }}
@@ -133,7 +133,7 @@ jobs:
133133
steps:
134134
- name: Get token from Github App
135135
id: app_token
136-
uses: actions/create-github-app-token@v2.1.4
136+
uses: actions/create-github-app-token@v2.2.0
137137
with:
138138
app-id: ${{ vars.DEVOPS_GITHUB_APP_ID }}
139139
private-key: ${{ secrets.DEVOPS_GITHUB_APP_PEM }}
@@ -154,7 +154,7 @@ jobs:
154154
steps:
155155
- name: Get GitHub App token
156156
id: app_token
157-
uses: actions/create-github-app-token@v2.1.4
157+
uses: actions/create-github-app-token@v2.2.0
158158
with:
159159
app-id: ${{ vars.DEVOPS_GITHUB_APP_ID }}
160160
private-key: ${{ secrets.DEVOPS_GITHUB_APP_PEM }}

.github/workflows/sync-internal.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
steps:
1212
- name: Get token from Github App
1313
id: app_token
14-
uses: actions/create-github-app-token@v2.1.4
14+
uses: actions/create-github-app-token@v2.2.0
1515
with:
1616
app-id: ${{ vars.DEVOPS_GITHUB_APP_ID }}
1717
private-key: ${{ secrets.DEVOPS_GITHUB_APP_PEM }}

packages/blocks/aws/src/lib/actions/arn/build-arn-action.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const buildArnAction = createAction({
1515
}),
1616
region: Property.ShortText({
1717
displayName: 'Region',
18-
required: true,
18+
required: false,
1919
}),
2020
accountId: Property.ShortText({
2121
displayName: 'Account ID',
@@ -33,7 +33,7 @@ export const buildArnAction = createAction({
3333
service,
3434
accountId,
3535
resource: resourceId,
36-
region,
36+
region: region ?? '',
3737
});
3838

3939
return arn;

packages/blocks/aws/test/arn/build-arn-action.test.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('buildArnAction', () => {
1717
},
1818
region: {
1919
type: 'SHORT_TEXT',
20-
required: true,
20+
required: false,
2121
},
2222
});
2323
});
@@ -36,4 +36,21 @@ describe('buildArnAction', () => {
3636
'arn:aws:ec2:us-west-2:123456789012:i-1234567890abcdef0',
3737
);
3838
});
39+
40+
test.each([undefined, null, ''])(
41+
'should build ARN without region when region=%p',
42+
async (regionVal) => {
43+
const result = await buildArnAction.run({
44+
...jest.requireActual('@openops/blocks-framework'),
45+
propsValue: {
46+
service: 'iam',
47+
region: regionVal as any,
48+
accountId: '123456789012',
49+
resourceId: 'user/David',
50+
},
51+
});
52+
53+
expect(result).toEqual('arn:aws:iam::123456789012:user/David');
54+
},
55+
);
3956
});

packages/react-ui/src/app/interceptors/request-interceptor.ts

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,9 @@
1-
import { API_URL, isUrlRelative } from '@/app/lib/api';
21
import { authenticationSession } from '@/app/lib/authentication-session';
32
import { InternalAxiosRequestConfig } from 'axios';
4-
5-
const unauthenticatedRoutes = [
6-
'/v1/authentication/sign-in',
7-
'/v1/authentication/sign-up',
8-
'/v1/authn/local/verify-email',
9-
'/v1/flags',
10-
'/v1/forms/',
11-
'/v1/user-invitations/accept',
12-
];
3+
import { isUrlRelative } from '../lib/api';
134

145
const needsAuthHeader = (url: string): boolean => {
15-
const resolvedUrl = !isUrlRelative(url) ? url : `${API_URL}${url}`;
16-
const isLocalUrl = resolvedUrl.includes(API_URL);
17-
const isUnauthenticatedRoute = unauthenticatedRoutes.some((route) =>
18-
url.startsWith(route),
19-
);
20-
21-
return !isUnauthenticatedRoute && isLocalUrl;
6+
return isUrlRelative(url);
227
};
238

249
export function createRequestInterceptor(): (

packages/react-ui/src/app/router.tsx

Lines changed: 69 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ const createRoutes = () => {
6565
FlagId.SHOW_DEMO_HOME_PAGE,
6666
);
6767

68+
const { data: isFederatedLogin } = flagsHooks.useFlag<boolean | undefined>(
69+
FlagId.FEDERATED_LOGIN_ENABLED,
70+
);
71+
6872
const routes = [
6973
{
7074
path: 'flows',
@@ -140,61 +144,6 @@ const createRoutes = () => {
140144
),
141145
errorElement: <RouteErrorBoundary />,
142146
},
143-
{
144-
path: 'forget-password',
145-
element: (
146-
<OpsErrorBoundary>
147-
<PageTitle title="Forget Password">
148-
<ResetPasswordPage />
149-
</PageTitle>
150-
</OpsErrorBoundary>
151-
),
152-
errorElement: <RouteErrorBoundary />,
153-
},
154-
{
155-
path: 'reset-password',
156-
element: (
157-
<OpsErrorBoundary>
158-
<PageTitle title="Reset Password">
159-
<ChangePasswordPage />
160-
</PageTitle>
161-
</OpsErrorBoundary>
162-
),
163-
errorElement: <RouteErrorBoundary />,
164-
},
165-
{
166-
path: 'sign-in',
167-
element: (
168-
<OpsErrorBoundary>
169-
<PageTitle title="Sign In">
170-
<SignInPage />
171-
</PageTitle>
172-
</OpsErrorBoundary>
173-
),
174-
errorElement: <RouteErrorBoundary />,
175-
},
176-
{
177-
path: 'verify-email',
178-
element: (
179-
<OpsErrorBoundary>
180-
<PageTitle title="Verify Email">
181-
<VerifyEmail />
182-
</PageTitle>
183-
</OpsErrorBoundary>
184-
),
185-
errorElement: <RouteErrorBoundary />,
186-
},
187-
{
188-
path: 'sign-up',
189-
element: (
190-
<OpsErrorBoundary>
191-
<PageTitle title="Sign Up">
192-
<SignUpPage />
193-
</PageTitle>
194-
</OpsErrorBoundary>
195-
),
196-
errorElement: <RouteErrorBoundary />,
197-
},
198147
{
199148
path: 'settings/appearance',
200149
element: (
@@ -278,6 +227,70 @@ const createRoutes = () => {
278227
),
279228
errorElement: <RouteErrorBoundary />,
280229
},
230+
];
231+
232+
if (!isFederatedLogin) {
233+
const regularLoginRoutes = [
234+
{
235+
path: 'forget-password',
236+
element: (
237+
<OpsErrorBoundary>
238+
<PageTitle title="Forget Password">
239+
<ResetPasswordPage />
240+
</PageTitle>
241+
</OpsErrorBoundary>
242+
),
243+
errorElement: <RouteErrorBoundary />,
244+
},
245+
{
246+
path: 'reset-password',
247+
element: (
248+
<OpsErrorBoundary>
249+
<PageTitle title="Reset Password">
250+
<ChangePasswordPage />
251+
</PageTitle>
252+
</OpsErrorBoundary>
253+
),
254+
errorElement: <RouteErrorBoundary />,
255+
},
256+
{
257+
path: 'sign-in',
258+
element: (
259+
<OpsErrorBoundary>
260+
<PageTitle title="Sign In">
261+
<SignInPage />
262+
</PageTitle>
263+
</OpsErrorBoundary>
264+
),
265+
errorElement: <RouteErrorBoundary />,
266+
},
267+
{
268+
path: 'verify-email',
269+
element: (
270+
<OpsErrorBoundary>
271+
<PageTitle title="Verify Email">
272+
<VerifyEmail />
273+
</PageTitle>
274+
</OpsErrorBoundary>
275+
),
276+
errorElement: <RouteErrorBoundary />,
277+
},
278+
{
279+
path: 'sign-up',
280+
element: (
281+
<OpsErrorBoundary>
282+
<PageTitle title="Sign Up">
283+
<SignUpPage />
284+
</PageTitle>
285+
</OpsErrorBoundary>
286+
),
287+
errorElement: <RouteErrorBoundary />,
288+
},
289+
];
290+
routes.push(...regularLoginRoutes);
291+
}
292+
293+
const redirectRoutes = [
281294
{
282295
path: 'redirect',
283296
element: <RedirectPage></RedirectPage>,
@@ -295,6 +308,7 @@ const createRoutes = () => {
295308
errorElement: <RouteErrorBoundary />,
296309
},
297310
];
311+
routes.push(...redirectRoutes);
298312

299313
if (isCloudConnectionPageEnabled) {
300314
const CloudConnectionPage = lazy(

0 commit comments

Comments
 (0)