Commit Graph

344 Commits

Author SHA1 Message Date
Ivar Conradi Østhus 3fc64a5f9f fix: FeatureHasTagError is formatting error message as Joi 2021-02-09 10:34:39 +01:00
Christopher Kolstad d1d271bb41 Add db-error code file 2021-02-09 10:19:35 +01:00
Christopher Kolstad 063d3f0e4a Make feature-toggle-store return 409
- After seeing frontend behaviour where the user could add the same
tag multiple times, and not get errors or be stopped doing so, we'll
change the backend to return a 409 if you tag a feature with a tag it
already has.

- Previous to this commit, the setup was to do `onConflict().ignore()`
  which caused the frontend to not get any help from the backend as to
  whether or not the operation was allowed

- This fix adds a custom error and adds a branch to the handleError util
  method for handling just that error type with a 409.

- This caused a couple of tests to receive 409, probably due to
  insufficient cleanup between tests. Adding faker as a dev-dependency and randomising
  toggle names and tag values for each test reduces the chance that
  we'll run into duplicate issues in the future for the tests that
  touches this problem

fixes: #711
2021-02-08 16:22:15 +01:00
Christopher Kolstad e952ae20a8 Added explicit pool settings in options.db object
- Also adds metrics for min and max pool size
- Metrics for free/used connections.
- Metrics for pending and current acquires

fixes: #705
2021-02-08 10:54:20 +01:00
Martin Lehmann ea6183f79c fix: upgrade prom-client from 12.0.0 to 13.1.0 2021-02-05 15:20:59 +01:00
Ivar Conradi Østhus 31f674d9fc fix: hide jira addon for now 2021-02-05 15:20:00 +01:00
Christopher Kolstad 786260434d fix: Add a test for validation of empty params 2021-02-05 15:20:00 +01:00
Christopher Kolstad dcf1224a17 fix: Add validation of required parameters 2021-02-05 15:20:00 +01:00
Ivar Conradi Østhus 65996e72e0 fix: add unleashUrl option 2021-02-05 15:20:00 +01:00
Ivar Conradi Østhus 2bb38fe3e8 fix: Addons should support sensitive params 2021-02-05 15:20:00 +01:00
Ivar Conradi Østhus 17c8fe7710 feat: Introduce addon framework
fixes: #587

Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai>
2021-02-05 15:20:00 +01:00
Ivar Conradi Østhus 9607ebce75 fix: should wait for seen apps 2021-02-04 15:54:29 +01:00
Alex Borys 806ecf7385 fix: typo in message in simple-authentication.js (#707)
`lib/middleware/simple-authentication.js`
2021-02-04 12:21:08 +01:00
Ivar Conradi Østhus 3a983d291c fix: even-store should not block on emit 2021-02-02 13:27:24 +01:00
Victor Login a320b6475d fix: Added the ability to specify db-schema via ENV (#702) 2021-02-02 12:40:42 +01:00
Ivar Conradi Østhus c500128f07 fix: Strategy schema should allow deprecated field (#700)
fixes: #698
2021-02-01 09:41:50 +01:00
Christopher Kolstad bd94f358c3 feat: Added tags to events table and emitted events
fixes: #695
2021-01-29 09:53:27 +01:00
Christopher Kolstad e555118cb1 feat: Add filterquery support for toggles
- For now supports
   - tag
   - project
   - namePrefix

fixes: #690
2021-01-26 14:14:07 +01:00
Ivar Conradi Østhus f5aa5b577c fix: remove fields from /api/client/features respnse (#692) 2021-01-22 13:09:26 +01:00
Christopher Kolstad 5f736ccf18 Make sure we deny deprecating default strategy 2021-01-22 10:03:01 +01:00
Christopher Kolstad ef19dfa7cb Support deprecating and reactivating strategies
fixes: #682
2021-01-21 15:53:24 +01:00
Christopher Kolstad c17a1980a2 Add service layer
This simplifies stores to just be storage interaction, they no longer react to events.

Controllers now call services and awaits the result from the call.

When the service calls are returned the database is updated.
This simplifies testing dramatically, cause you know that your state is
updated when returned from a call, rather than hoping the store has
picked up the event (which really was a command) and reacted to it.

Events are still emitted from eventStore, so other parts of the app can
react to events as they're being sent out.

As part of the move to services, we now also emit an application-created
event when we see a new client application.

Fixes: #685
Fixes: #595
2021-01-21 10:59:19 +01:00
Christopher Kolstad 43801f1f13 Add Tags and tag types
- First iteration of api for tags and tag-types
- Documentation in place
- Adds three new tables
   - tag_types
   - tags
   - feature_tag
- Tagging a feature is adding a row in the feature_tag
  join table

* #665

Co-authored-by: Simen Bekkhus <sbekkhus91@gmail.com>
Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
2021-01-14 13:09:05 +01:00
Ivar Conradi Østhus a1ac0249a9 fix: cleanup test console output 2021-01-06 18:06:56 +01:00
Ivar Conradi Østhus e279a700b8 fix: add unit test for lastSeenAt being updated 2020-12-22 11:05:00 +01:00
Ivar Conradi Østhus cdfba8f7b1 feat: Adds last-seen dat on toggles
When an application updates metrics for a toggle we now
stores the timestamp on the toggle when it was last seen
used by an application. This will make it much easier to
detect toggles not in use anymore.

closes #642
2020-12-22 11:05:00 +01:00
Ivar Conradi Østhus 79fc089a35 fix: stateService undefined 2020-12-17 19:43:01 +01:00
Laurent Dezitter 97b2c4985b test(server-impl): remove focus on test (#674) 2020-12-17 09:41:19 +01:00
Ivar Conradi Østhus 71eb88c847 fix: this.timer merge conflict 2020-12-16 14:56:48 +01:00
Laurent Dezitter 5857f0e58d feat: add stop() method to gracefully terminate unleash (#665) 2020-12-16 14:49:11 +01:00
Ivar Conradi Østhus 3bf01b803a fix: add support for basic auth with simple-auth (#659) 2020-12-03 21:29:01 +01:00
gazconroy c7c2f17bd0 feat: First draft of admin Open API specification (OAS) (#652)
Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
2020-12-03 21:09:16 +01:00
Ivar Conradi Østhus 143fed72dc fix: add import options as part of environment variables
closes https://github.com/Unleash/unleash-docker/issues/21
2020-11-25 20:22:56 +01:00
Ivar Conradi Østhus 5f2b684f57 feat: stateServices only exposed via services object 2020-11-23 21:52:57 +01:00
Ivar Conradi Østhus b644071a34 feat: Add technical support for projects 2020-11-23 21:47:51 +01:00
Mathias Åhsberg 144e832cdc feat: Add support for explicitly set database version. (#654)
Co-authored-by: Mathias Åhsberg <mathias.ahsberg@resurs.se>
2020-11-20 11:37:56 +01:00
Ivar Conradi Østhus 00ce76f9c5 fix: Allow spaces/special chars in application names
closes #534
2020-11-03 15:15:16 +01:00
Ivar Conradi Østhus 9c384dfae7 feat: Allow migration style import (#645) 2020-11-03 14:56:07 +01:00
Ivar Conradi Østhus 3c860d7bce fix: constriants must have at least one value defined
closes #640
2020-10-30 16:40:29 +01:00
Ivar Conradi Østhus 4f3a94cb86 fix: do not allow empty ('') constrain values.
related #640
2020-10-30 10:31:58 +01:00
Ivar Conradi Østhus 24347adbfb fix: context legalValues should be at max 100 chars 2020-10-04 20:36:40 +02:00
Ivar Conradi Østhus c65f7c27ee fix: enable trust-proxy 2020-10-02 16:40:42 +02:00
Ivar Conradi Østhus cd25078792 fix: upgrade cookie-session library 2020-10-02 16:38:51 +02:00
Ivar Conradi Østhus 34a7c2b244 fix: default maxAge for session set to two days
Unleash will now extend the session once every hour as long as
the user keeps the browser tab open within two days.
2020-10-02 16:34:16 +02:00
Ivar Conradi Østhus ce0c66d127 fix: add TTL to sessions 2020-10-02 16:32:05 +02:00
Ivar Conradi Østhus ef5b67974d fix: use validated and stripped data when updating 2020-10-01 22:40:47 +02:00
Ivar Conradi Østhus 192c292ecf fix: should use stripped update data for featureToggle 2020-10-01 22:34:28 +02:00
Ivar Conradi Østhus 0121a0e207 fix: set clear-site-data on logout 2020-10-01 21:57:33 +02:00
Ivar Conradi Østhus 5a58c2ea3f fix: use secure proxy to session cookie 2020-10-01 21:53:37 +02:00
Ivar Conradi Østhus 51f26be759 fix: add secureHeaders option for HSTS 2020-10-01 21:47:40 +02:00