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

161 Commits

Author SHA1 Message Date
andreas-unleash
1a27bffe4d
Complete open api schemas for project features controller (#1563)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)

* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)

* bug fix

* bug fix

* fix merge conflicts, some refactoring

* fix merge conflicts, some refactoring

* fix merge conflicts, some refactoring

* added emptyResponse, patch feature operation schemas and request

* added emptyResponse, patch feature operation schemas and request

* patch strategy

* patch strategy

* update strategy

* update strategy

* fix pr comment

* fix pr comments

* improvements

* added operationId to schema for better generation

* fix pr comment

* fix pr comment

* fix pr comment

* improvements to generated and dynamic types

* improvements to generated and dynamic types

* improvements to generated and dynamic types

* Update response types to use inferred types

* Update addTag response status to 201

* refactor: move schema ref destructuring into createSchemaObject

* made serialize date handle deep objects

* made serialize date handle deep objects

* add `name` to IFeatureStrategy nad fix tests

* fix pr comments

* fix pr comments

* Add types to IAuthRequest

* Sync StrategySchema for FE and BE - into the rabbit hole

* Sync model with OAS spec

* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)

* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)

* bug fix

* bug fix

* fix merge conflicts, some refactoring

* fix merge conflicts, some refactoring

* fix merge conflicts, some refactoring

* added emptyResponse, patch feature operation schemas and request

* added emptyResponse, patch feature operation schemas and request

* patch strategy

* patch strategy

* update strategy

* update strategy

* fix pr comment

* fix pr comments

* improvements

* added operationId to schema for better generation

* fix pr comment

* fix pr comment

* fix pr comment

* improvements to generated and dynamic types

* improvements to generated and dynamic types

* improvements to generated and dynamic types

* Update response types to use inferred types

* Update addTag response status to 201

* refactor: move schema ref destructuring into createSchemaObject

* made serialize date handle deep objects

* made serialize date handle deep objects

* add `name` to IFeatureStrategy nad fix tests

* fix pr comments

* fix pr comments

* Add types to IAuthRequest

* Sync StrategySchema for FE and BE - into the rabbit hole

* Sync model with OAS spec

* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)

* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)

* bug fix

* bug fix

* fix merge conflicts, some refactoring

* fix merge conflicts, some refactoring

* fix merge conflicts, some refactoring

* added emptyResponse, patch feature operation schemas and request

* added emptyResponse, patch feature operation schemas and request

* patch strategy

* patch strategy

* update strategy

* update strategy

* fix pr comment

* fix pr comments

* improvements

* added operationId to schema for better generation

* fix pr comment

* fix pr comment

* fix pr comment

* improvements to generated and dynamic types

* improvements to generated and dynamic types

* improvements to generated and dynamic types

* Update response types to use inferred types

* Update addTag response status to 201

* refactor: move schema ref destructuring into createSchemaObject

* made serialize date handle deep objects

* made serialize date handle deep objects

* add `name` to IFeatureStrategy nad fix tests

* fix pr comments

* fix pr comments

* Add types to IAuthRequest

* Sync StrategySchema for FE and BE - into the rabbit hole

* Sync model with OAS spec

* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)

* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)

* bug fix

* bug fix

* fix merge conflicts, some refactoring

* fix merge conflicts, some refactoring

* fix merge conflicts, some refactoring

* added emptyResponse, patch feature operation schemas and request

* added emptyResponse, patch feature operation schemas and request

* patch strategy

* patch strategy

* update strategy

* update strategy

* fix pr comment

* fix pr comments

* improvements

* added operationId to schema for better generation

* fix pr comment

* fix pr comment

* fix pr comment

* improvements to generated and dynamic types

* improvements to generated and dynamic types

* improvements to generated and dynamic types

* Update response types to use inferred types

* Update addTag response status to 201

* refactor: move schema ref destructuring into createSchemaObject

* made serialize date handle deep objects

* made serialize date handle deep objects

* add `name` to IFeatureStrategy nad fix tests

* fix pr comments

* fix pr comments

* Add types to IAuthRequest

* Sync StrategySchema for FE and BE - into the rabbit hole

* Sync model with OAS spec

* revert

* revert

* revert

* revert

* revert

* mapper

* revert

* revert

* revert

* remove serialize-dates.ts

* remove serialize-dates.ts

* remove serialize-dates.ts

* remove serialize-dates.ts

* remove serialize-dates.ts

* revert

* revert

* add mappers

* add mappers

* fix pr comments

* ignore report.json

* ignore report.json

* Route permission required

Co-authored-by: olav <mail@olav.io>
2022-05-18 16:17:09 +03:00
olav
8c1d4838b8
fix: require equal environments when moving toggles (#1595)
* fix: apply query from checkProjectsCompatibility

* fix: require equal environments when moving toggles

* refactor: clean up project service tests

* refactor: add test for project compatibility check

* refactor: improve arraysHaveSameItems name
2022-05-18 11:07:01 +02:00
sighphyre
5ef8dba7a7
fix: Upgrade knex to 2.0.0 and patch some stores to correctly order their count queries so they compile (#1579) 2022-05-09 15:20:12 +02:00
olav
56615e91f0
fix: validate the type and length of parameter values (#1559)
* refactor: coerce primitive types in OpenAPI requests

* refactor: avoid broken array args to serializeDates

* refactor: avoid some spec refs to improve generated types

* refactor: remove debug logging

* refactor: fix IExpressOpenApi interface name prefix

* refactor: ensure that parameter values are strings

* refactor: test that parameter values are coerced to strings
2022-05-04 15:16:18 +02:00
olav
e38f7cf7c2
feat: add context value descriptions (#1496)
* feat: add context value descriptions

* refactor: upcase SQL keywords

* refactor: allow blank descriptions
2022-04-19 08:40:07 +02:00
sighphyre
c9b44b6546
Merge pull request #1476 from Unleash/feat/multi-project-tokens
feat: Implement multi token support for client tokens
2022-04-08 11:51:31 +02:00
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
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
sighphyre
e889d8e29c feat: Implement multi token support for client tokens
This adds support for multi project tokens to be created. Backward compatibility is handled at 3 different layers here:

- The API is made backwards compatible though a permissive data type that accepts either a project?: string or projects?: string[] property, validation is done through JOI here, which ensures that projects and project are not set together. In the case of neither, this defaults to the previous default of ALL_PROJECTS
- The service layer method to handle adding tokens has been made tolerant to either of the above case and has been deprecated, a new method supporting only the new structure of using projects has been added
- Existing compatibility for consumers of Unleash as a library should not be affected either, the ApiUser constructor is now tolerant to the the first input and will internally map to the new cleaned structure
2022-04-06 08:11:41 +02: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
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
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
Ivar Conradi Østhus
8364c3b396 fix: add method to change role for project memeber 2022-03-03 08:52:44 +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
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
19cb991cc9
fix: metric counters should use bigint (#1313) 2022-01-31 08:50:11 +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
2b59a4219a
fix: Should not remove variants when updating feature toggle metadata (#1234) 2022-01-06 10:23:52 +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
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
cf70da71c9 fix: lint 2021-12-10 09:31:54 +01:00
Ivar Conradi Østhus
4a9939ccb1 feat: remove old metrics service 2021-12-10 09:31:54 +01:00
Youssef
00f5740d18 fix: rename last_update to updated_at 2021-11-30 15:25:52 +01:00
Youssef
c3273ce1ab fix: remove lastUpdate from fieldToRow 2021-11-30 15:14:50 +01:00
Youssef
10c1b56e38 add lastupdate to health report 2021-11-30 14:05:44 +01:00
Christopher Kolstad
5829ec7b3d
task: Sort variants by name (#1132) 2021-11-26 13:06:36 +01:00
Christopher Kolstad
72092e4a1c
fix: make new variant api validate name uniqueness (#1126) 2021-11-24 14:22:28 +01:00
Christopher Kolstad
6c6001619c
Feat/variant api (#1119)
Add a new .../:feature/variants API

This adds
- `GET /api/admin/projects/:projectId/features/:featureName/variants` which returns 
```json
{ version: '1', variants: IVariant[] }
```
- `PATCH /api/admin/projects/:projectId/features/:featureName/variants` which accepts a json patch set and updates the feature's variants field and then returns 
```json
{ version: '1', variants: IVariant[] }
```
- `PUT /api/admin/projects/:projectId/features/:featureName/variants`
 which accepts a IVariant[] and overwrites the current variants list for the feature defined in :featureName and returns
```json
{ version: '1', variants: IVariant[] }

- This also makes sure the total weight of all variants is == 1000
- Validates that there is at least 1 'variable' variant if there are variants
- Validates that 'fix' variants total weight can't exceed 1000
- Adds tests for all these invariants.


Co-authored-by: Simon Hornby <simon@getunleash.ai>
2021-11-24 13:08:04 +01:00
Fredrik Strand Oseberg
c369b77b24
Merge branch 'master' into feat/splash 2021-11-12 13:19:36 +01:00
Ivar Conradi Østhus
d8478dd928
feat: clean up events (#1089)
Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai>
2021-11-12 13:15:51 +01:00
Youssef Khedher
314c60393f
Merge branch 'master' into feat/splash 2021-11-12 11:30:08 +01:00
Ivar Conradi Østhus
f0895cf653
fix: prevent deadlock for batchinserting usage metrics (#1100)
* fix: prevent deadlock for batchinserting usage metrics

In client metrics v2 we utilize postgres to count the usage
across a few dimentions (featureName, app_name, environment).

It turns out that if the UPDATE values are not executed in a predictable
order we can end up in a deadlock scenario with postgresql.

In this fix we thus sort the metrics on the feature_name, app_name and
envrionment, to make sure they always are executed in a predictabel
order, and thus avoiding independent inserts colliding in to a deadlock
waiting for eachother.

* fix: tests cannot assume order
2021-11-11 16:05:29 +01:00
Fredrik Oseberg
d73293c576 fix: add migration 2021-11-09 11:52:02 +01:00
Youssef
875fb7734c create splash migration store and service file 2021-11-08 16:31:38 +01:00
Martin Lehmann
b47e228181
fix: be explicit when specifying time & replace moment with date-fns (#1072) 2021-11-02 15:13:46 +01:00
Martin Lehmann
607b2a6657
fix: use date-fns for date/time maths instead of (wrong) Date#setHours (#1070)
Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
2021-10-26 20:13:30 +02:00
Christopher Kolstad
6914bd7908
fix: Only trigger environment enabled/disabled events if different f… (#1053)
Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
2021-10-21 22:33:50 +02:00
Christopher Kolstad
26407cc02e
Fix/feature strategies needs project update (#1040)
* Make sure feature_strategies follow feature to new project
2021-10-19 09:49:43 +02:00
Ivar Conradi Østhus
5f6758d8f0
fix: update context field does not await the response (#1027) 2021-10-14 08:30:36 +02:00
Christopher Kolstad
20a4aeff97
Make Appinstance registration include environment (#1014) 2021-10-12 10:39:28 +02:00
Ivar Conradi Østhus
fc455811f8
feat/metricsV2 (#1005)
Adds a new way of handling usage metrics where we push it directly to the database and performs aggregation on the fly. All metrics are aggregated in to buckets of hours. We will for now store metrics for the 48 hours with the following dimensions:

- featureName
- projectName
- envrionment
- yes (the actual count)
- no (the actual count)
2021-10-08 10:09:22 +02:00
Christopher Kolstad
b4b222f4c9
feat: add new more specific feature/environment events to addons (#994)
* feat: add new more specific feature/environment events to addons

* Updated strategy change text

* Update all three addon messages for strategy

* Link to new features view for strategy change text

Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
2021-10-07 10:22:20 +02:00
Fredrik Strand Oseberg
12245664ad
fix: add sort order to environments (#1004)
* fix: add sort order to environments

* fix: lint

* fix: remove display name
2021-10-06 09:39:59 +02:00
Christopher Kolstad
a401580228
task: Disables feature_environments without strategies (#1003) 2021-10-06 09:25:34 +02:00
Ivar Conradi Østhus
ee660c8eef
fix: client api should return feature toggles for disabled environments (#995)
* fix: client api should return feature toggles for disabled environments

* fix: add test

* lint
2021-10-01 12:27:05 +02:00
Ivar Conradi Østhus
54a99460ce
fix: add projects api for oss as well 2021-10-01 10:59:43 +02:00
Christopher Kolstad
e3cebb21c8
task: add default environment (#989)
- Adds development and production environments.
- Connects default environment to all projects
- When creating a project connects the project to all enabled
  environments
2021-09-29 11:09:35 +02:00
Christopher Kolstad
c870b33ba6
task: remove displayName from environments (#988)
This will require a change in enterprise as well.
2021-09-29 10:23:43 +02:00
Christopher Kolstad
77d781db12
task: Adds FEATURE_ENVIRONMENT_{ENABLED,DISABLED} events (#970)
* task: Adds FEATURE_ENVIRONMENT_{ENABLED,DISABLED} events
2021-09-27 14:07:26 +02:00
Ivar Conradi Østhus
4b7e1f4a81
feat: rename :global: env to "default" (#947)
Our testing and internal validation has proven that
the :global: environment concept confuses people more
than the problems it solves. We have thus decided to
group all configuration that was created before the
environment concept was introduced in to the "default
environment. This would still make everything work
as before in addition to introducing the env concept.

Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai>
2021-09-24 13:55:00 +02:00
Christopher Kolstad
62b0bcbdc4
fix: Added displayName to feature environments 2021-09-23 16:25:24 +02:00
Christopher Kolstad
e7b948e9db
Add type to environments
- Now returns type as part of the environment object when requesting
  a feature
2021-09-23 16:16:31 +02:00
Christopher Kolstad
f85f66d4f5
feat: add project and environment columns to events (#942)
* feat: add project and environment columns to events

* Added events for feature_strategy update

* fix duplicate test key for dbInit

* Fix argument list for toggleService calls in tests
2021-09-20 12:13:38 +02:00
Christopher Kolstad
37d6c4886a
Respect sort order when displaying strategies (#943) 2021-09-17 15:11:17 +02:00
Ivar Conradi Østhus
c4b697b57d
Feat/api key scoping (#941)
Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai>
2021-09-15 20:28:10 +02:00
Fredrik Strand Oseberg
26c9d53b89
feat: Move environments to enterprise (#935)
- Adding, updating and renaming environments are meant to be
  enterprise only features, as such, this PR moves these operations out
  of this server

- We still keep sortOrder updating, toggling on/off and getting one,
  getting all, so we can still work with environments in the OSS version
  as well.

Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai>

Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai>
2021-09-13 15:57:38 +02:00
Ivar Conradi Østhus
90962434d9
fix: Cleanup new features API with env support (#929) 2021-09-13 10:23:57 +02:00
Ivar Conradi Østhus
dff86fcfff fix: add resetDb to migrator 2021-09-10 12:25:12 +02:00
Ivar Conradi Østhus
c518ddf84c fix: improve performance for fetching active api tokens 2021-09-02 12:46:29 +02:00
Ivar Conradi Østhus
aab4602029
fix: add user and project counters 2021-08-27 10:10:14 +02:00
Ivar Conradi Østhus
56cd0d6912
fix: import should not drop built-in strategies 2021-08-26 22:41:51 +02:00
Ivar Conradi Østhus
d28df3e3fa
Fix/feature events (#924) 2021-08-26 13:59:11 +02:00
Ivar Conradi Østhus
8cb147a81f
fix: getFeatureToggleAdmin should include project 2021-08-25 15:14:07 +02:00
Fredrik Strand Oseberg
cdc2e7daee
fix: add properties to legacy endpoints (#919)
Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
2021-08-19 13:34:24 +02:00
Ivar Conradi Østhus
d3fbaa6587
fix: add member and toggle count to project list (#918) 2021-08-19 13:25:36 +02:00
Christopher Kolstad
ff7be7696c
fix: Stores as typescript and with interfaces. (#902)
Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
2021-08-12 15:04:37 +02:00
Christopher Kolstad
9646bcfebb
fix: only import feature_tags for imported features 2021-07-30 13:38:28 +02:00
Fredrik Oseberg
45fdd6e2f6 fix: return empty array if no features are found for project 2021-07-14 13:17:20 +02:00
Ivar Conradi Østhus
815a75a5b4
Wip/environments (#880)
Adds environment support

This PR adds environments as a first-class concept in Unleash.

It necessitated a full rewrite on how we connect feature <-> strategy, as well as a rethink on which levels environments makes sense.

This enables PUTs on strategy configurations for a feature, since all strategies now have ids.

This also updates export/import format. The importer handles both formats, but export is no longer possible in version 1 of the export format, only in version 2, with strategy configurations for a feature as a separate object.

Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai>
Co-authored-by: Fredrik Oseberg <fredrik.no@gmail.com>
Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
2021-07-07 10:46:50 +02:00
checketts
2f013bacbf
chore: Convert client metrics controller to typescript (#831)
Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
2021-06-24 19:22:12 +02:00
Ivar Conradi Østhus
4f9deee2ed
fix: add option for graceful shutdown (#872)
* fix: add option for graceful shutdown

* fix: gracefulShutdown should close idle keep-alive connections

* fix: eslint import order

* docs: add config options to docs as well
2021-06-17 20:33:34 +02:00
Fredrik Strand Oseberg
9f33285b03
Feat/pnps feedback (#862)
* feat: setup user feedback service

* fix: map rows

* feat: add tests

* wrap service calls in try catch

* fix: add test for retrieving feedback on user

* feat: add fake user feedback store

* fix: check ffor feedback id in controller

* feat: add test for bad request
2021-06-07 11:11:42 +02:00
Christopher Kolstad
3a65847aa7
Migrate to jest (#854)
* Migrate to jest
* Use --force-exit until dns close handle issue https://github.com/facebook/jest/issues/9982

Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
2021-05-28 11:10:24 +02:00
Christopher Kolstad
5565dd8c4b
chore: expose an endpoint to really delete a toggle (#808)
* chore: expose an endpoint to really delete a toggle

- To provide a way to run end-to-end tests without cluttering
  our demo instance with way too many feature-toggles, making this
  endpoint available will allow end-to-end tests to clean up properly
  after themselves
2021-05-06 14:11:56 +02:00
Ivar Conradi Østhus
841e2a6e07
fix: more types 2021-05-02 21:11:17 +02:00
Christopher Kolstad
4c3a77bc31
fix: project store was wrongly typing its id field as number (#822) 2021-04-30 12:51:46 +02:00
Christopher Kolstad
7cbe6bfcc1
fix: deletes sessions for user when user is removed (#810) 2021-04-29 10:54:11 +02:00
Ivar Conradi Østhus
df2e23c282
fix: refactor event types 2021-04-29 10:21:29 +02:00
Christopher Kolstad
578078e03f
fix: active sessions are now destroyed if auth/reset and auth/validate endpoints are used (#806) 2021-04-27 09:16:44 +02:00
Christopher Kolstad
c729f514cf
fix: make users emails case-insensitive (#804) 2021-04-23 15:30:23 +02:00
Christopher Kolstad
97d77d84cc fix: emailservice now just returns if email was configured 2021-04-23 15:24:32 +02:00
Ivar Conradi Østhus
b406d3c7cf
fix: should allow revive toggles 2021-04-23 13:29:24 +02:00
Fredrik Strand Oseberg
c58612fc8f
Feat/add new user email (#793)
* feat: send email when adding a new user

* fix: rename method

* fix: create welcome email

* fix: update email templates

* fix: add name to templates

* refactor: reduce database calls to one

* fix: alter tests

* fix: remove console logs
2021-04-23 10:58:47 +02:00
Ivar Conradi Østhus
b0e6d8c363
fix: User should require a ID field set (#799) 2021-04-22 23:40:52 +02:00
Ivar Conradi Østhus
15b1e5514f
fix: skipLocked when updating lastSeen for toggles
(second attempt)

see: #795 for deatils.
2021-04-22 22:02:42 +02:00
Ivar Conradi Østhus
b3d830617c
fix: skipLocked when updating lastSeen for toggles 2021-04-22 20:18:49 +02:00
Christopher Kolstad
7776f3c940
Fix/strategies sort order (#798)
* feat: add sort order field to strageies
* feat: update strategy display name and description

Co-authored-by: Fredrik Oseberg <fredrik.no@gmail.com>
2021-04-22 13:33:35 +02:00
Christopher Kolstad
240c6a77a1
Feat/options need types (#794)
feat: options are now typed

- This makes it easier to know what to send to unleash.start / unleash.create
- Using a Partial to instantiate the config, then melding it with defaults to get a config object with all fields set either to their defaults or to whatever is passed in.


Co-authored-by: Fredrik Strand Oseberg <fredrik.no@gmail.com>
Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
2021-04-22 10:07:10 +02:00
Christopher Kolstad
4246baee16
feat: add ui-bootstrap endpoint (#790)
* feat: add ui-bootstrap endpoint

- Reducing calls needed for frontend to 1 instead of the current 6

fixes: #789
2021-04-20 12:32:02 +02:00
Christopher Kolstad
b55c85783b
Reset token (#786)
feat: Add Reset token functionality

This allows admin users to create a reset token for other users. Thus allowing resetting their password.

Co-authored-by: Fredrik Oseberg <fredrik.no@gmail.com>

fixes: #778
2021-04-16 15:29:23 +02:00
Ivar Conradi Østhus
9e7d2f845a
fix: migrate all permissions to rbac (#782)
* fix: migrate all permissions to rbac
* fix: update migration guide

fixes #782
2021-04-12 20:25:03 +02:00
Ivar Conradi Østhus
9bd425c193
feat: Add username/password authentication (#777) 2021-04-09 13:46:53 +02:00
Christopher Kolstad
99fd210392
feat: added basic email-service (#780)
* feat: added basic email-service
* feat: preview endpoint for plaintext/html templates
* chore: Updated docs
fixes: #757
2021-04-09 11:16:06 +02:00
Ivar Conradi Østhus
dfb890c638
Feat: Api-Tokens (#774)
fixes: #774
2021-03-29 19:58:11 +02:00
Christopher Kolstad
205ad921d4
Tags and tag types to ts (#772)
* chore: Converted tag-store and tag-type-store to ts

* chore: Converted tag service and tag type service to ts
2021-03-26 11:03:30 +01:00
Christopher Kolstad
2e13bb9368
Make sure we keep the announced status of each app (#770)
* Make sure we keep the announced status of each app

- Since we were running onConflict().merge() we were keeping our entire
  new object from our remapRow method, and that was overwriting the
  current announcement status of the row back to false, unless we'd by
  random chance actually set the announced property on our row to be
  inserted.
* Add migration for cleaning up application-created events
-
fixes: #769
2021-03-23 12:43:33 +01:00