-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validates client config #1116
base: feature/distributed-demo
Are you sure you want to change the base?
Validates client config #1116
Conversation
…nfig-2 658 validate client config 3
@atomicgamedeveloper Is this PR complete w.r.t the changes discussed in PR #1083? |
We're getting close, though change number 6. requires some ingenuity. Please note my comments under the proposed changes of 1., 4., 6., 8 and 9.
I moved
if (typeof window !== 'undefined') {
window.env = {
REACT_APP_ENVIRONMENT: 'dev',
REACT_APP_URL: 'http://localhost:4000/',
REACT_APP_URL_BASENAME: '',
REACT_APP_URL_DTLINK: '/lab',
REACT_APP_URL_LIBLINK: '',
REACT_APP_WORKBENCHLINK_VNCDESKTOP: '/tools/vnc/?password=vncpassword',
REACT_APP_WORKBENCHLINK_VSCODE: '/tools/vscode/',
REACT_APP_WORKBENCHLINK_JUPYTERLAB: '/lab',
REACT_APP_WORKBENCHLINK_JUPYTERNOTEBOOK: '',
REACT_APP_WORKBENCHLINK_LIBRARY_PREVIEW: '/preview/library',
REACT_APP_WORKBENCHLINK_DT_PREVIEW: '/preview/digitaltwins',
REACT_APP_CLIENT_ID: '1be55736756190b3ace4c2c4fb19bde386d1dcc748d20b47ea8cfb5935b8446c',
REACT_APP_AUTH_AUTHORITY: 'https://gitlab.com/',
REACT_APP_REDIRECT_URI: 'http://localhost:4000/Library',
REACT_APP_LOGOUT_REDIRECT_URI: 'http://localhost:4000',
REACT_APP_GITLAB_SCOPES: 'openid profile read_user read_repository api',
};
};
I assume you want a clean, simple design here, so for now it just displays this message and no concrete config problems, i.e. And not
I've looked into different ways of having a singular verification of the config. One idea is to wrap the app in a
This is not started.
The current implementation of SignIn is tested and it doesn't break any other tests. But with a new implementation we need new tests of course. Functions like fetching the different URLs or the getVerifications are not tested either. |
export const routes = [
{
path: '/',
element: (
<LayoutPublic containerMaxWidth="md">
<Config role='user' />
</LayoutPublic>
),
},
{
path: 'config/verify',
element: (
<LayoutPublic containerMaxWidth="md">
<Config role='developer' />
</LayoutPublic>
),
},
{
path: 'signin',
element: (
<LayoutPublic>
<SignIn />
</LayoutPublic>
),
},
{
path: 'login',
element: (
<LayoutPublic>
<SignIn />
</LayoutPublic>
),
},
......
]; Please note that a successful verification of config on "/" route redirects page to "/signin" route. Another improvement could be to store the result of config validation in redux store and use it in other routes. All other routes can use (reducers) to deal with config changes. The advantages of this method are:
|
Yes. Is the box responsive?
Please skip it for this PR
No problem. I am going to do one review of PR now. Please let me know when the PR is ready for next review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@atomicgamedeveloper please see the comments.
client/src/route/config/Verify.tsx
Outdated
); | ||
}; | ||
|
||
export type validationType = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these members are used in getConfigIcon()
as mandatory parameters. I am surprised that tsc has not thrown an error.
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6. - [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md) - [Commits](moxystudio/node-cross-spawn@v7.0.3...v7.0.6) --- updated-dependencies: - dependency-name: cross-spawn dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.7 to 3.3.8. - [Release notes](https://github.com/ai/nanoid/releases) - [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md) - [Commits](ai/nanoid@3.3.7...3.3.8) --- updated-dependencies: - dependency-name: nanoid dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]>
…n/client/cross-spawn-7.0.6 Bump cross-spawn from 7.0.3 to 7.0.6 in /client
…n/client/nanoid-3.3.8 Bump nanoid from 3.3.7 to 3.3.8 in /client
…amedeveloper/DTaaS into feature/distributed-demo
@atomicgamedeveloper , the codeclimate issues seem to have gone up in this PR. Please check the existing issues vs new ones. Please resolve them. |
@atomicgamedeveloper , I have checked the code changes and they seem fine. Then I tried the code inside docker container using the It shows the invalid configuration on the signin page and the configuration verification page shows the following error. Please note that the docker scenario runs the client behind traefik proxy. How does it effect the functionality? The existing setup in |
The codeclimate issues in the new code: Some of these files have duplication shown for fewer than 5 lines. You can increase the duplication mass in codeclimate.yml to ignore these duplication issues. Please remember to increase the mass only for typescript and not for others. |
Copied from previous PR #1083:
Title
Validates client config.
Fixes #658
Type of Change
Description
This PR will provide a route to validate the client config file. A comprehensive, manual one for developers, and another one that automatically redirects users in case their config is incorrectly setup or URLs are unreachable.
It will also update the client dependencies. Related to issue #658.
Testing
Manual testing for now.
Impact
Additional Information
None.
Checklist
existing code.