Commit Graph

323 Commits

Author SHA1 Message Date
Salvatore Novelli 7ddbff2669 feat: add "application_name" as an optional DB option #1170 (#1478)
* implemented changes to resolve issue 1170

* added applicationName to the list of db options in the documentation'

Co-authored-by: Daniele Casal <daniele.casal@lloydsbanking.com>
Co-authored-by: Sukhvinder Panesar <79143027+esspee-lbg@users.noreply.github.com>
2022-04-07 20:55:56 +02:00
abhinav1708 66c66c7e4a feat: events for feature tag and untag (#1355) 2022-04-06 20:51:01 +02:00
Nuno Góis 794327f8e0 fix: reject duplicate segment names (#1475)
* fix: reject duplicate segment names

* refactor: remove unnecessary comment

* refactor: improve validateName logic with existsByName

* fix: removed unused NotFoundError import
2022-04-06 14:01:50 +01:00
olav 9f7d878422 fix: add missing awaits (#1472)
* refactor: silence expected console.error call

* fix: add missing access service awaits

* fix: add missing constraint validation await
2022-04-01 11:10:21 +02:00
olav 1da38781d5 feat: add segment limits (#1469)
* feat: add segment limits

* refactor: move segment limits to constants
2022-04-01 10:53:52 +02:00
olav cf06b562f9 fix: allow instance ID to be empty for metrics (#1471) 2022-04-01 10:34:22 +02:00
olav 66d9d7a6d2 feat: add segments (#1426)
* refactor: fix missing tsconfig path in .eslintrc

* refactor: require contextName and operator

* refactor: fix crash on missing feature strategies

* feat: add segments schema

* feat: add segments client API

* feat: add segments permissions

* refactor: fail migration if things exist

* refactor: remove strategy IDs from responses

* refactor: allow empty description

* refactor: add segment import/export

* refactor: add perf scripts

* refactor: add get segment fn

* refactor: move constraint validation endpoint

* refactor: use a separate id for segment updates

* refactor: use PERF_AUTH_KEY for artillery

* refactor: adjust segment seed size

* refactor: add missing event data await

* refactor: improve method order

* refactor: remove request body limit override
2022-03-29 14:59:14 +02:00
Youssef Khedher d11d0e712b refactor: block creating token for disabled environment (#1464)
* refactor: block creating token for disabled environment

Co-authored-by: olav <mail@olav.io>

* refactore: remove unused deps

Co-authored-by: olav <mail@olav.io>
2022-03-24 11:26:00 +01:00
olav 1cc43c0a4a refactor: always add values to constraints (#1448) 2022-03-17 12:32:04 +01:00
sighphyre 8f60dd6958 Merge pull request #1431 from Unleash/enabled-environments-override
Add enabled environments override flag
2022-03-16 14:45:55 +02:00
Fredrik Strand Oseberg a236a61623 Fix/user added event (#1437)
* 4.9.0-beta.1

* chore: update unleash frontend

* 4.9.0-beta.2

* fix: add user email to project user events
2022-03-16 08:44:30 +01:00
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
Fredrik Strand Oseberg 55469801cf feat: validate strategies (#1429)
* feat: validate strategies

* fix: optional coalescing on constraints

* fix: update test
2022-03-10 14:43:53 +01: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