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

274 Commits

Author SHA1 Message Date
Youssef
875fb7734c create splash migration store and service file 2021-11-08 16:31:38 +01:00
Ivar Conradi Østhus
645a8bce05
fix: convert iso-strings from db to date object 2021-11-04 22:16:48 +01:00
Ivar Conradi Østhus
053956b45e
fix/projectId cannot change for strategy configs (#1084) 2021-11-04 21:24:55 +01:00
Fredrik Strand Oseberg
ec60f4485c
fix: disable projects (#1085) 2021-11-04 21:09:52 +01:00
Lennart
759b592d90
fix: update mime library method signature to 2.X (#1078)
Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
2021-11-02 23:43:16 +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
Ivar Conradi Østhus
4fb1bcb524
feat: Disable password based login (#1046)
This commit will introduce a new setting used to disbaled
simple password based authention.

The setting itself is an enterprise setting.
2021-10-29 10:25:42 +02:00
Ivar Conradi Østhus
9e73ed8f47
chore: remvoe console.error for tests expecting error 2021-10-29 09:25:47 +02:00
Ivar Conradi Østhus
8040abb1c4
fix: reuse message formatter for addons (#1058) 2021-10-28 14:09:11 +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
Ivar Conradi Østhus
1924961efa
fix: simplify how we update projects 2021-10-21 21:06:56 +02:00
Ivar Conradi Østhus
a0d5b04388
fix: only send FEATURE_UPDATED for legacy (#1054)
Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai>
2021-10-21 20:53:39 +02:00
Christopher Kolstad
b7b5f0caa0
fix: add constraint for changing project. (#1049)
- In order for a feature toggle to be allowed to change project, the
  target project must have the same enabled environments.
- If the feature toggle has an environment which is not in use that does
  not exist in target project, this is ok.

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

Co-authored-by: Fredrik Strand Oseberg <fredrik.no@gmail.com>
2021-10-21 10:29:09 +02:00
Ivar Conradi Østhus
3484340cd0
fix: only add project environments if enabled (#1050) 2021-10-21 10:14:35 +02:00
Christopher Kolstad
1f37b0bf4b
fix: make hasPermission call handle api tokens (#1041) 2021-10-19 11:34:56 +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
3b925902d7
fix: event-log 2021-10-15 20:11:51 +02:00
Ivar Conradi Østhus
41574e3938
fix: create admin users if enabled and zero users already 2021-10-12 21:39:57 +02:00
Christopher Kolstad
20a4aeff97
Make Appinstance registration include environment (#1014) 2021-10-12 10:39:28 +02:00
Christopher Kolstad
d176028a00 Trigger STALE events when patching stale field
- Also moved the patch function into service, instead of performing the
  operation in the controller
2021-10-11 11:27:20 +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
Ivar Conradi Østhus
3612884501
feat: clone feature toggle API (#1006) 2021-10-08 09:37:27 +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
Christopher Kolstad
a401580228
task: Disables feature_environments without strategies (#1003) 2021-10-06 09:25:34 +02:00
Ivar Conradi Østhus
796f202da3
fix: lint 2021-10-01 22:28:09 +02:00
Ivar Conradi Østhus
fa56124b89
fix: do not filter FEATURE_METADATA_UPDATE events 2021-10-01 13:04:00 +02:00
Ivar Conradi Østhus
54a99460ce
fix: add projects api for oss as well 2021-10-01 10:59:43 +02:00
Christopher Kolstad
efdbda68e4
fix: reduce data in FEATURE_ENVIRONMENT events 2021-09-29 12:58:02 +02:00
Ivar Conradi Østhus
0a83abe101
fix: add environments to project details (#992) 2021-09-29 12:22:04 +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
Ivar Conradi Østhus
f6169540a5
fix: Store metrics only if not empty (#991) 2021-09-29 09:47:49 +02:00
renovate[bot]
120eb2b2fa
fix(deps): update dependency js-yaml to v4 (#985)
* fix(deps): update dependency js-yaml to v4

* fix: upgrade to js-yaml v4

* fix: upgrade to js-yaml 4.1.0

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
2021-09-28 20:53:39 +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
e42e0f620a
fix: don't include archived feature strategies (#955) 2021-09-24 08:55:53 +02:00
Christopher Kolstad
5af2633d6d
added tests and exports for 3.17, 4.0 and 4.1 (#944)
Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
2021-09-20 12:29:16 +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
Ivar Conradi Østhus
24b057ab6d
fix: lint error 2021-09-14 20:43:05 +02:00
Ivar Conradi Østhus
ab4744e79b
fix: convert schemas to typescript 2021-09-14 20:36:40 +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
635d50e1a8 fix: addon-service should only trigger enabled addons
fixes: #932
2021-09-02 12:46:29 +02:00
Ivar Conradi Østhus
9b521de34e
fix: correct data format for FEATURE_CREATED event 2021-08-27 19:30:51 +02:00
Ivar Conradi Østhus
cecdd96863
fix: only add strategies to addon texts when available 2021-08-27 10:15:56 +02:00
Ivar Conradi Østhus
14857b01c8
fix: import schema needs to understand :global: env 2021-08-26 22:42:06 +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
Fredrik Strand Oseberg
856c7a358b
Fix/switch project endpoint (#923) 2021-08-25 13:38:00 +02:00
Ivar Conradi Østhus
bb47c19d4d
fix: only update name if not undefined 2021-08-25 12:43:42 +02:00
Ivar Conradi Østhus
8cbf378286
feat: sync fields when logging in via SSO (#916) 2021-08-23 12:11:29 +02:00
Ivar Conradi Østhus
d3fbaa6587
fix: add member and toggle count to project list (#918) 2021-08-19 13:25:36 +02:00
Ivar Conradi Østhus
bb9ae03b27
Revert "fix: uri encode smtp connection string (#901)"
This reverts commit 8f1a5f5a64.
2021-08-16 10:24:28 +02:00
Ivar Conradi Østhus
2bcdb5ec31
fix: Controller wraps handler with try/catch (#909)
By having the controller perform try/catch around the
handler function allows us to add extra safety to all
our controllers and safeguards that we will always catch
exceptions thrown by a controller method.
2021-08-13 10:36:19 +02:00
Ivar Conradi Østhus
5760d10e70
Revert "fix: upgrade js-yaml to 4.1.0"
This reverts commit 4852d67049.
2021-08-12 23:00:47 +02:00
Ivar Conradi Østhus
4852d67049
fix: upgrade js-yaml to 4.1.0 2021-08-12 22:47:44 +02:00
James Renaud
8f1a5f5a64
fix: uri encode smtp connection string (#901)
Signed-off-by: James Renaud <james.renaud@mitel.com>

Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
2021-08-12 22:32:16 +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
Ivar Conradi Østhus
806b4a4a59
fix: failing tests 2021-08-10 13:50:59 +02:00
Christopher Kolstad
9646bcfebb
fix: only import feature_tags for imported features 2021-07-30 13:38:28 +02:00
Fredrik Oseberg
72993002a2 fix: always add global environment to new projects 2021-07-14 13:20:36 +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
bef375e7bf
fix: userFeedback should not be allowed to throw 2021-06-08 20:21:14 +02:00
Ivar Conradi Østhus
8e3e973f22
fix: make sure routes/user handles api calls 2021-06-08 20:15:03 +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
Ivar Conradi Østhus
f9ef945404
fix: projects needs at least one owner 2021-05-25 19:28:29 +02:00
Ivar Conradi Østhus
e095691c1e
fix: lint 2021-05-21 19:16:08 +02:00
Christopher Kolstad
171b5182a5 fix: misunderstanding node URL api 2021-05-11 14:43:41 +02:00
Christopher Kolstad
0086580130 fix: reset-token-service should use unleashUrl 2021-05-07 10:38:41 +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
0bed8f605e
fix: regular users are not API users 2021-05-03 19:33:37 +02:00
Ivar Conradi Østhus
4b48c08e0e
fix: move permission to types 2021-05-02 20:58:02 +02:00
Ivar Conradi Østhus
0efc238fdb
fix: define root role by setting the name of the role (#823) 2021-04-30 13:25:24 +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
568998f20a
fix: import statements for type/events 2021-04-29 10:29:39 +02:00
Ivar Conradi Østhus
df2e23c282
fix: refactor event types 2021-04-29 10:21:29 +02:00
Ivar Conradi Østhus
886e0bb008
feat: add user create/update/delete events (#807) 2021-04-27 20:47:11 +02:00
Christopher Kolstad
d0b17af770
fix: handle password being undefined when validating (#809) 2021-04-27 15:35:10 +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
0de4c98a58
fix: send email on process.nextTick (#805)
To avoid users having to wait while we wait for a response from the email provider, we now send the mail on nextTick
2021-04-27 09:05:46 +02:00
Ivar Conradi Østhus
5e53927991
fix: fix test data 2021-04-26 12:21:18 +02:00
Ivar Conradi Østhus
2874ae71b6
fix: change default admin password 2021-04-26 11:28:51 +02:00
Ivar Conradi Østhus
b4b524a11b
feat: add option for LOG_LEVEL (#803) 2021-04-23 15:31:12 +02:00
Christopher Kolstad
7cb7e4a193 fix: simplify isConfigured check 2021-04-23 15:01:22 +02:00
Ivar Conradi Østhus
f261f546cc
fix: loading of emailtemplates 2021-04-23 14:53:56 +02:00
Ivar Conradi Østhus
d021f4ebc5
fix: lint 2021-04-23 12:55:11 +02:00
Ivar Conradi Østhus
709d12a1dc
fix: hasPermission should not throw 2021-04-23 12:52:29 +02:00
Christopher Kolstad
8845c90f57 Added enterpriseVersion to root of IUnleashConfig/IUnleashOptions 2021-04-23 11:05:30 +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
424d4e209e
fix: introduce settingService 2021-04-22 22:54:08 +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
23ea21babf
fix: rename rbac roles. (#788)
* fix: rename rbac roles.

Root-roles:
- Admin
- Editor
- Viewer

Project roles:
- Owner
- Member

* Update src/lib/services/access-service.ts

* Update src/migrations/20210415173116-rbac-rename-roles.js

Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai>
2021-04-16 10:45:15 +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
Ivar Conradi Østhus
b6793d2957
fix: version-checker must have instanceId 2021-03-26 14:38:51 +01:00
Ivar Conradi Østhus
5d284e3ac9
fix: ensure createdBy is not empty 2021-03-26 13:57:01 +01:00
Christopher Kolstad
acc39fe38d chore: another missing type 2021-03-26 12:35:14 +01:00
Christopher Kolstad
f191d76737 chore: type argument missing 2021-03-26 12:34:37 +01: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
3e2ec968f2 fix: always set instanceid in uiconfig 2021-03-15 08:46:28 +01:00
Christopher Kolstad
289cf85a3c
Add import/export for tags and projects (#754)
* Add import/export for tags and projects

Tags includes (tags, tag-types and feature-tags)

fixes: #752
2021-03-12 11:08:10 +01:00
Ivar Conradi Østhus
e1fbe9d013
feat: Default roles and RBAC permission checker. (#735)
This PR Introduces first steps towards RBAC according to our specifications. Rbac will assume users to exist in the Unleash user table with a unique id. This is required to make correct mappings between users and roles.
2021-03-11 22:51:58 +01:00
Ivar Conradi Østhus
40bde7c08b
fix: projectId must follow nameType in query 2021-03-05 14:12:56 +01:00
Christopher Kolstad
9e649118e5
fix: publish events about unannounced applications
fixes: #747
2021-03-05 14:01:15 +01:00
Fredrik Strand Oseberg
8e0bae7352
feat/return feature on create (#742)
* feat: return feature on create

* refactor: change test to verify returning object

* fix: return undefined instead of null
2021-03-04 13:28:31 +01:00
Christopher Kolstad
ec3d6e95bc chore: remove superfluous logging from client registration 2021-03-04 13:04:32 +01:00
Christopher Kolstad
4808eb32ff
feat: add support for bulk operations on client apps/instance registr… (#744)
* feat: add support for bulk operations on client apps/instance registration
-- stores client registrations for 5 seconds, then runs distinct and inserts them into db

fixes: #732
2021-03-04 12:54:13 +01:00
Ivar Conradi Østhus
55dd2ed72b
fix: project id should be validated correctly on create 2021-02-24 13:24:28 +01:00
Clint Checketts
5f83fbc43d chore: Add eslint rules and fix strings to pass rules 2021-02-22 22:20:10 -07:00
Christopher Kolstad
35486efe77
Add instance id to ui-config endpoint 2021-02-22 14:21:23 +01:00
Christopher Kolstad
c2db551252
fix: Don't check version when starting up in dev mode 2021-02-19 11:16:35 +01:00
Christopher Kolstad
b83387a84a
Add a version service (#729)
- Checks versions against https://version.unleash.run
- Generates a unique instance id (uuid)
2021-02-19 11:13:25 +01:00
Ivar Conradi Østhus
b17e9a4bda
feat: Introduce specific "feature stale" events (#727)
fixes: #776
2021-02-18 09:18:04 +01:00
Fredrik Strand Oseberg
c1aab06798
Feature/setup typescript
This sets up the typescript compiler.

Allowing gradual migration to typescript.

Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai>
Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
Co-authored-by: Fredrik Oseberg <fredrik.oseberg@getunleash.ai>
Co-authored-by: Clint Checkett <clintchecketts@churchofjesuschrist.org>

fixes: #676
2021-02-12 11:42:00 +01:00