Skip to content
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

Feat: force reset password when first time login #716

Merged
merged 13 commits into from
Apr 4, 2023

Conversation

chivalryq
Copy link
Member

@chivalryq chivalryq commented Mar 23, 2023

Description of your changes

When first time login, force user to reset the admin password.

First time login

image

After init admin
image

Fixes #

I have:

  • Read and followed KubeVela's contribution process.
  • Related Docs updated properly. In a new feature or configuration option, an update to the documentation is necessary.
  • Run yarn lint to ensure the frontend changes are ready for review.
  • Run make reviewableto ensure the server changes are ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

Special notes for your reviewer

@chivalryq chivalryq changed the title Force reset password when first time login Feat: force reset password when first time login Mar 23, 2023
@codecov
Copy link

codecov bot commented Mar 23, 2023

Codecov Report

Patch coverage: 64.51% and project coverage change: +10.95 🎉

Comparison is base (d2582ed) 50.13% compared to head (970a242) 61.09%.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #716       +/-   ##
===========================================
+ Coverage   50.13%   61.09%   +10.95%     
===========================================
  Files          98       99        +1     
  Lines       17974    18081      +107     
===========================================
+ Hits         9012    11047     +2035     
+ Misses       7815     5692     -2123     
- Partials     1147     1342      +195     
Flag Coverage Δ
apiserver-unittests 32.60% <45.02%> (?)
server-e2e-tests 49.94% <45.16%> (-0.20%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/server/domain/service/system_info.go 75.89% <ø> (+8.66%) ⬆️
pkg/server/interfaces/api/dto/v1/types.go 73.33% <ø> (+33.33%) ⬆️
pkg/server/utils/auth.go 67.24% <25.00%> (-3.13%) ⬇️
pkg/server/utils/context.go 40.00% <40.00%> (ø)
pkg/server/interfaces/api/authentication.go 45.85% <43.47%> (-0.82%) ⬇️
pkg/server/event/sync/store.go 69.02% <63.63%> (-4.28%) ⬇️
pkg/server/domain/service/rbac.go 69.55% <66.66%> (+10.63%) ⬆️
pkg/server/domain/service/user.go 54.64% <68.62%> (+16.46%) ⬆️
pkg/server/domain/service/authentication.go 50.38% <69.23%> (+25.18%) ⬆️
pkg/server/domain/service/project.go 59.12% <87.50%> (+15.88%) ⬆️
... and 5 more

... and 29 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@barnettZQG barnettZQG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please enhance your code.

packages/velaux-ui/src/pages/Login/index.tsx Outdated Show resolved Hide resolved
packages/velaux-ui/src/pages/Login/index.tsx Show resolved Hide resolved
pkg/server/domain/service/user.go Outdated Show resolved Hide resolved
pkg/server/interfaces/api/authentication.go Show resolved Hide resolved
@chivalryq chivalryq force-pushed the feat/init-admin branch 2 times, most recently from 263d3f8 to f03d771 Compare March 30, 2023 09:37
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Add test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

add initialize admin twice test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

use es6 braces code format

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

lint style and remove init admin

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

fix tests

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

remove the legacy admin init logic

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

remove all model.DefaultAdminUserName in non-test file

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
pkg/server/domain/service/user.go Fixed Show resolved Hide resolved
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
remove addon enable process before e2e test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
Copy link
Collaborator

@barnettZQG barnettZQG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@barnettZQG barnettZQG merged commit bceaad7 into kubevela:main Apr 4, 2023
mujinhuakai pushed a commit to mujinhuakai/velaux that referenced this pull request Apr 8, 2023
* Force reset password when first time login

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Add test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

add initialize admin twice test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

use es6 braces code format

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

lint style and remove init admin

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

fix tests

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

remove the legacy admin init logic

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

remove all model.DefaultAdminUserName in non-test file

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* remove model.DefaultAdminUserName in test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* tidy code

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* reviewable

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* Fix unit test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix unit test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* Fix auth ut

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix dex login test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix broken configure admin ut

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix auth ut

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* reviewable

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* add debug log

remove addon enable process before e2e test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* remove debug info

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

---------

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
Signed-off-by: liyanfang <liyanfang@cmss.chinamobile.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants