Repository navigation
Conversation
/api/v1/expressions/env and /check were the only routes without the authentication filter, so they answered anyone. A test now sends every registered route a request without a token and fails on any that does not refuse it, apart from a short list of public routes, each with the reason a signed-out user needs it. Signed-off-by: Brian Kane <briankane1@gmail.com>
CreateConfig took the template's namespace from the request and rendered it with VelaUX's own service account, whatever the project. A config may now use a template only from the system namespace or, for a project config, the project's namespace, the namespaces VelaUX lists templates from. An update keeps the config's existing template, so configs created elsewhere still edit as before. Signed-off-by: Brian Kane <briankane1@gmail.com>
The key VelaUX signs access and refresh tokens with was stored in the system info record, which the default datastore keeps in a ConfigMap. The key now lives in the velaux-token-signing-key Secret, created on first start. A key still held in the system info record is removed and not reused, so every user signs in again once after the upgrade. Signed-off-by: Brian Kane <briankane1@gmail.com>
Migration adopts a config before its template, and addons install their config templates as legacy ConfigMaps, so a Config can stand on a template that is not a ConfigTemplate. Updating one looked the template up only as a ConfigTemplate and failed with 16005, the template does not exist, leaving the config uneditable in VelaUX. The update now resolves the template with Factory.LoadTemplate, the ConfigTemplate first and the legacy ConfigMap after it, and validates the properties against whichever it finds. Signed-off-by: Brian Kane <briankane1@gmail.com>
The permission filter authorized the project in the request's path or query, while an application or environment create wrote to the project named in its body, and an environment create granted RBAC in that project's namespaces. The create refuses (403, 30011) a body project other than the one the request was authorized for. A request authorized with no project held a permission over every project and is not limited. The UI sends the same project in both places, so it is unaffected. Signed-off-by: Brian Kane <briankane1@gmail.com>
The search box on the application list sends ?query=, and the list skipped an app only when the query was missing from its alias but present in both its name and its description, so a search left the list as it was. An app is listed when the query appears in its name, alias or description, ignoring case. Signed-off-by: Brian Kane <briankane1@gmail.com>
VelaUX offered a module's component types under their definitions' installed names, which KubeVela refuses for a module-backed definition (it takes module/version/name), so a component made from one could not be created. Modules are still in development, so their definitions, which carry the definition.oam.dev/module label, are left out of every definition list VelaUX serves, the type pickers included. Signed-off-by: Brian Kane <briankane1@gmail.com>
The login page reads /auth/dex_config before anyone signs in, so the endpoint answers without authentication, and its response carried the Dex static client's secret. The response now holds only what the browser sees in the authorize redirect: the issuer, the client ID and the redirect URL. The server's own code exchange reads the secret from the stored Dex config. Signed-off-by: Brian Kane <briankane1@gmail.com>
Every install's Dex static client had the same secret, velaux-secret. A new Dex config gets a random secret (32 bytes from crypto/rand). At startup, an install still holding the old default is given one of its own and Dex is restarted to read it; a secret anyone set is kept. A failure to replace it is logged and VelaUX starts as before. Signed-off-by: Brian Kane <briankane1@gmail.com>
… delete and logout The local login built its own user record without the Disabled flag, so a disabled user could still sign in with a password. Tokens were checked only for their signature and expiry, never against their user, and refreshing returned the same refresh token. Local login now refuses a disabled user before recording the login. Every user carries a token generation, stamped into each token issued to them; every request and every refresh loads the user and accepts the token only while the user exists, is enabled and is at that generation. Disabling, a password change, a change of roles and the new POST /api/v1/auth/logout raise it, ending all of the user's sessions (code 12013). Refreshing issues a new refresh token, and each token carries an id. The user the check loads is handed on in the request context, so the RBAC filter and the plugin proxy do not read it again. The UI's logout calls the new endpoint before clearing the browser's tokens, and a request refused with 12013 goes to the sign-in prompt as an expired refresh token does. Signed-off-by: Brian Kane <briankane1@gmail.com>
1 task done
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #984 +/- ##
===========================================
+ Coverage 12.17% 48.65% +36.47%
===========================================
Files 120 155 +35
Lines 19935 20248 +313
===========================================
+ Hits 2428 9852 +7424
+ Misses 17218 10396 -6822
+ Partials 289 0 -289
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of your changes
The VelaUX fixes from the v1.12 release testing, one commit each, best reviewed commit by commit:
Each commit message says what was wrong and what changed. The user-visible ones are in the v1.12 upgrade guide
(kubevela/kubevela.github.io#1473).
I have:
How has this code been tested
Each fix has a test written first that fails without it. The Go tests pass (25 packages), lint is clean, and the UI
type-checks.
Special notes for your reviewer
stays a draft until then.