1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
Commit Graph

311 Commits

Author SHA1 Message Date
sighphyre
91fa0ed296 fix: update config tests for enabled environments 2022-03-14 10:01:05 +02:00
sighphyre
8410a8e3ac feat: enabled environments override now also moves projects and toggles to new environments 2022-03-11 15:52:13 +02:00
sighphyre
c3b064adfc feat: Add environment variable to set override enabled environments 2022-03-11 11:16:58 +02:00
sighphyre
3910e23d2d
Merge pull request #1408 from Unleash/feat/init-client-tokens
Load Client Tokens From Environment on Startup
2022-03-09 09:53:47 +02:00
Fredrik Strand Oseberg
6f075e4d1c
Feat/new constraint operators (#1397)
* feat: add migration for currentTime context field

* feat: add tests for number validator

* feat: add validation fields for constraint

* feat: add validation for semver, date and legalvalues

* fix: import paths

* fix: only allow specified operators

* fix: add operator test

* fix: reset db

* fix: remove unused import

* fix: set semver as dependency
2022-03-04 17:29:42 +01:00
Youssef
d4521a1c0c fix: changeRole to assign roles without existing members
Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai>
2022-03-03 14:33:32 +01:00
Ivar Conradi Østhus
d514356030 fix: avoid scope issues 2022-03-03 08:52:44 +01:00
Ivar Conradi Østhus
faa87469ff Update src/lib/types/events.ts
Co-authored-by: Fredrik Strand Oseberg <fredrik.no@gmail.com>
2022-03-03 08:52:44 +01:00
Ivar Conradi Østhus
7f391e2b48 Update src/lib/types/events.ts
Co-authored-by: Fredrik Strand Oseberg <fredrik.no@gmail.com>
2022-03-03 08:52:44 +01:00
Ivar Conradi Østhus
f0abc0e0d6 Update src/lib/types/events.ts
Co-authored-by: Fredrik Strand Oseberg <fredrik.no@gmail.com>
2022-03-03 08:52:44 +01:00
Ivar Conradi Østhus
017bd75c9c Update src/lib/services/project-service.ts
Co-authored-by: Fredrik Strand Oseberg <fredrik.no@gmail.com>
2022-03-03 08:52:44 +01:00
Ivar Conradi Østhus
2f189db394 Update src/lib/services/project-service.ts
Co-authored-by: Fredrik Strand Oseberg <fredrik.no@gmail.com>
2022-03-03 08:52:44 +01:00
Ivar Conradi Østhus
8364c3b396 fix: add method to change role for project memeber 2022-03-03 08:52:44 +01:00
sighphyre
6de5fdb565 feat: allow startup to load client tokens from env var 2022-03-02 13:44:46 +02:00
Christopher Kolstad
fc4d95ff5b
fix: configure user endpoint when AuthType is NONE (#1403)
Co-authored-by: Fredrik Oseberg <fredrik.no@gmail.com>
2022-03-01 10:52:22 +01:00
Christopher Kolstad
3704f93ff5
fix: readd orderBy statement to project query (#1394) 2022-02-25 08:32:12 +01:00
Christopher Kolstad
34e5034547
fix: reduce project overview query count to 2. (#1356)
* fix: reduce project overview query count to 2.

Previously we've been doing N+1 queries for projects, this now changes to doing one query for projects with feature counts, and then one query for membercounts for all projects and merging that with the first query.
2022-02-21 12:46:28 +01:00
olav
eb08ed0b55
refactor: add an hoursBack query param to the raw metrics endpoint (#1373)
* refactor: add an hoursBack query param to the raw metrics endpoint

* refactor: explicitly return undefined

* refactor: make parseHoursBackQueryParam non-static

* refactor: add test for hoursBack query param

* refactor: improve arg name

* refactor: add a 1 hour test case
2022-02-17 10:47:05 +01:00
Fredrik Strand Oseberg
6520aa1b0c
Feat/impression data (#1310)
* feat: add impression data column

* fix: add default value to impressionData

* fix: allow client api to return impressionData

* fix: add tests for impressionData

* fix: reset server-dev

* fix: add test for adding a toggle with impression data on a different project

* fix: update tests
2022-02-03 11:06:51 +01:00
Ivar Conradi Østhus
e5035f96e1
fix: rbac should pick up projectId from path if available 2022-02-01 22:58:52 +01:00
Ivar Conradi Østhus
19cb991cc9
fix: metric counters should use bigint (#1313) 2022-01-31 08:50:11 +01:00
Ivar Conradi Østhus
1cad01b97e
fix: welcome-email should not include password-link when disabled (#1302) 2022-01-28 12:50:35 +01:00
Ivar Conradi Østhus
332b94d209
fix: convert simple-password-provider.test.js to ts 2022-01-26 22:44:26 +01:00
Ivar Conradi Østhus
a50d0e2a21
fix: improve API error-handling (#1301)
Unleash is an API and it would simplyfy a lot of the specific
errors could carry the expected HTTP status code for this error.
This would eliminate the need for a gigantic switch/case in the
handle-errors function.
2022-01-26 13:45:22 +01:00
Ivar Conradi Østhus
14a305f0e7
fix: upgrade node-fetch to version 2.6.7 2022-01-23 21:29:42 +01:00
Fredrik Strand Oseberg
8ecacfb89c
Fix/validate context (#1282)
* fix: add context guards

* fix: change error message

* fix: remove console log
2022-01-21 12:02:05 +01:00
Ivar Conradi Østhus
367b31185b
fix: allow charset in content-type (#1241) 2022-01-20 15:00:16 +01:00
sighphyre
dc920e85ba
Fix/add project events (#1267)
* fix: wip project events

* fix: Include deletion events for when a user is removed from a project role

Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
2022-01-14 12:14:02 +01:00
sighphyre
e164e3d835
Merge pull request #1266 from Unleash/feat/block-deletion-of-root-roles
fix: Prevent deletion of built in roles
2022-01-14 12:55:55 +02:00
Fredrik Strand Oseberg
1989c53fb0
fix: enable tags and validate for legacy api (#1264)
* fix: enable tags and validate for legacy api

* fix: move delete tag

* fix: test name

* fix: move /api/admin/features
2022-01-14 11:16:17 +01:00
sighphyre
bfcad65cdc fix: Prevent deletion of built in roles 2022-01-14 10:30:34 +02:00
Ivar Conradi Østhus
c1826ca79a
fix: incorrect snapshot 2022-01-14 09:23:32 +01:00
sighphyre
0c78980502
feat: custom project roles (#1220)
* wip: environment for permissions

* fix: add migration for roles

* fix: connect environment with access service

* feat: add tests

* chore: Implement scaffolding for new rbac

* fix: add fake store

* feat: Add api endpoints for roles and permissions list

* feat: Add ability to provide permissions when creating a role and rename environmentName to name in the list permissions datastructure

* fix: Make project roles resolve correctly against new environments permissions structure

* fix: Patch migration to also populate permission names

* fix: Make permissions actually work with new environments

* fix: Add back to get permissions working for editor role

* fix: Removed ability to set role type through api during creation - it's now always custom

* feat: Return permissions on get role endpoint

* feat: Add in support for updating roles

* fix: Get a bunch of tests working and delete a few that make no sense anymore

* chore: A few small cleanups - remove logging and restore default on dev server config

* chore: Refactor role/access stores into more logical domains

* feat: Add in validation for roles

* feat: Patch db migration to handle old stucture

* fix: migration for project roles

* fix: patch a few broken tests

* fix: add permissions to editor

* fix: update test name

* fix: update user permission mapping

* fix: create new user

* fix: update root role test

* fix: update tests

* feat: Validation now works when updating a role

* fix: Add in very barebones down migration for rbac so that tests work

* fix: Improve responses from role resolution - getting a non existant role will throw a NotFound error

* fix: remove unused permissions

* fix: add test for connecting roles and deleting project

* fix: add test for adding a project member with a custom role

* fix: add test for changing user role

* fix: add guard for deleting role if the role is in use

* fix: alter migration

* chore: Minor code cleanups

* chore: Small code cleanups

* chore: More minor cleanups of code

* chore: Trim some dead code to make the linter happy

* feat: Schema validation for roles

* fix: setup permission for variant

* fix: remove unused import

* feat: Add cascading delete for role_permissions when deleting a role

* feat: add configuration option for disabling legacy api

* chore: update frontend to beta version

* 4.6.0-beta.0

* fix: export default project constant

* fix: update snapshot

* fix: module pattern ../../lib

* fix: move DEFAULT_PROJECT to types

* fix: remove debug logging

* fix: remove debug log state

* fix: Change permission descriptions

* fix: roles should have unique name

* fix: root roles should be connected to the default project

* fix: typo in role-schema.ts

* fix: Role permission empty string for non environment type

* feat: new permission for moving project

* fix: add event for changeProject

* fix: Removing a user from a project will now check to see if that project has an owner, rather than checking if any project has an owner

* fix: add tests for move project

* fix: Add in missing create/delete tag permissions

* fix: Removed duplicate impl caused by multiple good samaritans putting it back in!

* fix: Trim out add tag permissions, for now at least

* chore: Trim out new add and delete tag permissions - we're going with update feature instead

* chore: update frontend

* 4.6.0-beta.1

* feat: Prevent editing of built in roles

* fix: Patch an issue where permissions for variants/environments didn't match the front end

* fix: lint

Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
Co-authored-by: Fredrik Oseberg <fredrik.no@gmail.com>
2022-01-13 11:14:17 +01:00
Ivar Conradi Østhus
4a5b332567
fix: make sure our CSP allow gravatar.com for images 2022-01-12 23:22:04 +01:00
Ivar Conradi Østhus
73685c771a
fix: allow static assets from cdn.getunleash.io 2022-01-06 21:08:16 +01:00
Ivar Conradi Østhus
559275129d
Fix/bcryptjs (#1239)
fixes: #1108
2022-01-06 20:43:57 +01:00
Ivar Conradi Østhus
26b7da8b5c
feat: add support for cdnPrefix for static assets (#1191) 2022-01-06 10:31:00 +01:00
Ivar Conradi Østhus
2b59a4219a
fix: Should not remove variants when updating feature toggle metadata (#1234) 2022-01-06 10:23:52 +01:00
Ivar Conradi Østhus
66d4aa61de
fix: correct format for API tokens 2022-01-05 10:40:22 +01:00
Juraj Malenica
e757c00840
feat: Add init api tokens option (#1181)
Adds support for initializing a fresh Unleash instance with predefined API tokens. 

Co-authored-by: sighphyre <liquidwicked64@gmail.com>
Co-authored-by: Juraj Malenica <juraj.malenica@mindsmiths.com>
Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
2022-01-05 10:00:59 +01:00
Ivar Conradi Østhus
c051eb9149
fix: expose ApiUser out of Unleash 2022-01-04 20:01:18 +01:00
sighphyre
5a82d9be87
fix: Update updateUser code to reject empty emails (#1210)
* fix: Update updateUser code to reject empty emails

This fixes an issue where the updateUser call would allow null email
addresses, then update the email to null and then raise an exception,
leaving the db in a state where no user could be resolved.

* fix: remove username/email requirement in user.ts

Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
2022-01-03 20:14:56 +01:00
Ivar Conradi Østhus
8d8d48026d
fix: adjust feature-variant-updated event 2021-12-17 04:30:39 +01:00
Christopher Kolstad
994db02f84
fix: Adds feature-variant-updated event. (#1189)
This triggers when we update or overwrite variants, and will include the
previous variants and the new variants.

Co-authored-by: Ivar Østhus <ivarconr@gmail.com>
2021-12-16 11:07:19 +01:00
Christopher Kolstad
791384ddb1
Fix/variants ordering (#1187)
* fix: sort variants on output

We found that for existing variants, the sorting by name wasn't applied, so the index in the patches were wrong. This PR adds the sort also when we're getting variants as part of the getFeature call, not just when we're getting the variants. This should make the UX consistent, and prevent our patches from hitting the wrong index in the variants array.

Co-authored-by: Youssef Khedher <khedher.youssef@hotmail.fr>
2021-12-15 14:20:32 +01:00
Ivar Conradi Østhus
08bff6359c fix: uintroduce call to update last_seen on client-instance 2021-12-10 09:31:54 +01:00
Ivar Conradi Østhus
bf1223e07d fix: rename services 2021-12-10 09:31:54 +01:00
Ivar Conradi Østhus
cf70da71c9 fix: lint 2021-12-10 09:31:54 +01:00
Ivar Conradi Østhus
bb4e6290d5 fix: move toggle-counters to metrics service 2021-12-10 09:31:54 +01:00
Ivar Conradi Østhus
9f13b801eb fix: rename metrics-service to client-instance service 2021-12-10 09:31:54 +01:00