1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
Commit Graph

209 Commits

Author SHA1 Message Date
ivaosthu
95d36b89d7 Use joi instead of assert 2020-02-20 08:34:06 +01:00
ivaosthu
77482bd7a7 Fix typo in simple-authentication.js 2020-02-20 08:34:06 +01:00
ivaosthu
f4feab89f3 Implement authentication support for Unleash UI.
Closes: #261, #233, #232, #231
2020-02-20 08:34:06 +01:00
ivaosthu
57df35f6a5 Fix pathname reporting in middlewares 2020-02-20 08:34:06 +01:00
ivaosthu
1695a35555 Add unit tests for archived toggles 2020-02-20 08:34:06 +01:00
ivaosthu
4999bb93cf Should not be allow creation of archived toggle
closes #284
2020-02-20 08:34:05 +01:00
ivaosthu
089268825f Fix typo in custom validator 2020-02-20 08:34:04 +01:00
ivaosthu
37f9ed9570 Implement cookie-session support.
Sessions will be required to solve admin-auth.

I also refactored a few middlewares into seperate
files to make the code easier to read.

closes #262
2020-02-20 08:34:04 +01:00
ivaosthu
5711c46cbf Add cookie-session dependency 2020-02-20 08:34:04 +01:00
Simen Bekkhus
e5e8f3bee9 Upgrade Log4JS (#274) 2020-02-20 08:34:03 +01:00
Simen Bekkhus
3aa871ca97 Update prettier and fix lint 2020-02-20 08:34:03 +01:00
Ivar
f093d609ae Use pkginfo to resolve unleash-server version
closes #268
2020-02-20 08:34:03 +01:00
ivaosthu
6642978fc7 Remove log-message in test 2020-02-20 08:34:03 +01:00
Ivar
5e1fd4ae8e Simplofy name validator
closes #271
2020-02-20 08:34:03 +01:00
Ivar
e679d5d975 Fix formatting 2020-02-20 08:34:00 +01:00
Martin Lehmann
c957aeba94 Fix feature name validation regex 2020-02-20 08:33:47 +01:00
ivaosthu
12ef0db1f1 Bugfix: use basUrl when logging actual request path 2020-02-20 08:33:47 +01:00
Clint Brown
3e7098578b Allow underscores in name validation 2020-02-20 08:33:47 +01:00
Ivar
d58289540c Include module version number in /api reponse 2020-02-20 08:33:46 +01:00
Ivar
6bc23f04da Added option to disable legacy routes. Closes #244 2020-02-20 08:33:46 +01:00
Ivar
eb346756d2 Clean up intervals.
We use intervals in three places and we could probably organise them
better in the future. As long as they all do unref they do not form
any issues for us and I will just let them be as is for now.

This closes #186
2020-02-20 08:33:46 +01:00
Simen Bekkhus
54ca4ffc77 Upgrade prom-client and add gc-stats 2020-02-20 08:33:46 +01:00
Simen Bekkhus
3b260abbfe Replace sinon with lolex 2020-02-20 08:33:46 +01:00
ivaosthu
e97a3820a2 Added validation of provided LoggerProvider 2020-02-20 08:33:33 +01:00
ivaosthu
f5e9ca3bbe Implement support for logger provider.
This allows the users of 'unleash-server' to programatically
change the logger implemnentation. #175
2020-02-20 08:33:33 +01:00
ivaosthu
f2cc426ed7 Fix assert 2020-02-20 08:33:33 +01:00
ivaosthu
f91a24eabe Add metrics validation to avoid NaN #253 2020-02-20 08:33:33 +01:00
ivaosthu
18afb520d0 Strip uknown fields in client requests. closes #245 2020-02-20 08:33:33 +01:00
ivaosthu
f826c837fd Disable x-powered-by express header 2020-02-20 08:33:33 +01:00
sveisvei
b137cf0eaa add editable tests 2020-02-20 08:33:16 +01:00
sveisvei
a9b783443b shoulda woulda 2020-02-20 08:33:16 +01:00
sveisvei
ae245293f4 protection against edit on built in strategies 2020-02-20 08:30:52 +01:00
Ivar
915158212c Add support for sdkVersion in client registration 2020-02-20 08:30:52 +01:00
sveisvei
1131440535 auto disable, and do not serve archived toggle 2020-02-20 08:30:52 +01:00
Simen Bekkhus
e1cc0b2e99 Upgrade prom-client and yargs 2020-02-20 08:30:51 +01:00
sveisvei
93bb1ac66d should expose one feature 2020-02-20 08:30:51 +01:00
sveisvei
0ae24c68e6 Refactor routes setup, move test files, cleanup legacy 2020-02-20 08:30:51 +01:00
sveisvei
71815a1320 Remove legacy data support 2020-02-20 08:30:51 +01:00
sveisvei
375a8b1d4f Prettier/lint 2020-02-20 08:30:50 +01:00
Simen Bekkhus
e85ac8a52f Log client error (#225)
* Log client error

* Log all errors
2020-02-20 08:30:50 +01:00
sveisvei
6e4a22bf54 use object.assign and pass along options 2020-02-20 08:30:50 +01:00
sveisvei
fa6c28de8f pass along hooks, add test to server impl 2020-02-20 08:30:50 +01:00
sveisvei
86ac44908d validate configures strategy shape 2020-02-20 08:30:49 +01:00
Simen Bekkhus
21e0522116 Remove uncaught exception logging
This is the responsibility of the app
2020-02-20 08:30:48 +01:00
vsandvold
743a597f42 provides a more helpful error msg when a new feature is created with an existing name 2020-02-20 08:30:46 +01:00
sveisvei
07dc23d23d use post instead of put 2020-02-20 08:30:46 +01:00
sveisvei
32a0b93096 add toggle endpoint 2020-02-20 08:30:46 +01:00
ivaosthu
8beb4b8876 Add simple API resource #191 2020-02-20 08:30:46 +01:00
ivaosthu
df7ad8c8bf Strategy name can be up to 100chars . Closes #195 2020-02-20 08:30:45 +01:00
sveisvei
925e42045f add sanity tests for metrics 2020-02-20 08:30:45 +01:00
sveisvei
ae195b5674 evict if new item directly is not eligible 2020-02-20 08:30:45 +01:00
sveisvei
efc9ae2f5d fix typ0 that broke time.now 2020-02-20 08:30:45 +01:00
sveisvei
17c58e77f2 add hook tests 2020-02-20 08:30:45 +01:00
sveisvei
2f1680d9c0 add app hooks 2020-02-20 08:30:45 +01:00
sveisvei
1d3faca238 fix lint 2020-02-20 08:30:45 +01:00
ivaosthu
744e41f9aa Strategy parameter description is allowed to be empty 2020-02-20 08:30:43 +01:00
ivaosthu
79de8fb7ed Added api for updating a strategy
relates to #184
2020-02-20 08:30:43 +01:00
ivaosthu
bc1f647f92 use fake timers for ttl test 2020-02-20 08:30:43 +01:00
sveisvei
f5578d986e check toggles and strategies in clientapps 2020-02-20 08:30:43 +01:00
ivaosthu
c8a9b39f27 Add schema validation for strategies 2020-02-20 08:30:43 +01:00
ivaosthu
ba5810506f Fix failing tests 2020-02-20 08:30:43 +01:00
ivaosthu
97f6731140 Strategy list should be sorted by name 2020-02-20 08:30:43 +01:00
sveisvei
381e7d4763 inject metadata on toplevel 2020-02-20 08:30:43 +01:00
sveisvei
d160fe933f serve with metadata 2020-02-20 08:30:43 +01:00
sveisvei
76d642069b Revert "Remove /api/client/seen-toggles as we don't need it anyway"
This reverts commit 63e6931265.
2020-02-20 08:30:42 +01:00
ivaosthu
52fcfb4a2b Remove /api/client/seen-toggles as we don't need it anyway 2020-02-20 08:30:42 +01:00
ivaosthu
51442a6cc4 Remove client_strategies table
We can just have a strategies column in the client_applications
table. This solves all our needs, and thus avoids the need
for an extra table.
2020-02-20 08:30:42 +01:00
ivaosthu
8764b952b3 A client-register should upsert client_applications table 2020-02-20 08:30:42 +01:00
sveisvei
5ad5127f81 fix lint and mock 2020-02-20 08:30:42 +01:00
sveisvei
3a6e7d02ef client applications 2020-02-20 08:30:42 +01:00
sveisvei
066fe5fdd2 recieve togglename to archive or revive via path 2020-02-20 08:30:42 +01:00
sveisvei
92111890d9 uppercase event type key constants 2020-02-20 08:30:42 +01:00
Ivar Conradi Østhus
377ad43bab Delete app.js 2020-02-20 08:30:42 +01:00
ivaosthu
9c6fad83c2 Added enpoint for fetching application implementing a strategy
`/api/client/applications?strategyName=foo` now returns list of
apps implementing that strategy!
2020-02-20 08:30:42 +01:00
sveisvei
803fc6752d send toggleName back 2020-02-20 08:30:42 +01:00
ivaosthu
b12a188faf amend prev commit 2020-02-20 08:30:42 +01:00
ivaosthu
6cdffb22d0 fix strateiges format for /client/applications 2020-02-20 08:30:42 +01:00
sveisvei
a959dc777d fetch seen apps instead 2020-02-20 08:30:42 +01:00
sveisvei
7609d0abeb add getAppsFromToggleName 2020-02-20 08:30:42 +01:00
sveisvei
d3063073b3 fix typ0 2020-02-20 08:30:42 +01:00
sveisvei
a1303f4c42 only log if num of cleaned is above 0 2020-02-20 08:30:41 +01:00
sveisvei
b5b846835b add single toggle metric endpoint 2020-02-20 08:30:41 +01:00
sveisvei
f425597640 fix lint 2020-02-20 08:30:41 +01:00
ivaosthu
d4d63af2b0 Option to disable request logging.
Because all request details are available via
prometheus there is no need to also log all requests.

This solves #164 but we should still replace log4j with something else.
2020-02-20 08:30:41 +01:00
ivaosthu
7057d11553 replace commander with yargs 2020-02-20 08:30:41 +01:00
ivaosthu
bec646d797 more tests 2020-02-20 08:30:41 +01:00
ivaosthu
35ad3aa072 cleanup bin 2020-02-20 08:30:40 +01:00
ivaosthu
f1a24be0e2 minor cleanup 2020-02-20 08:30:40 +01:00
ivaosthu
471518b41d Simplify metrics: We only need timings as it includes counts for free 2020-02-20 08:30:40 +01:00
ivaosthu
e075917136 cleanup 2020-02-20 08:30:40 +01:00
ivaosthu
8e6bcafa24 Server Metrics: add response time and status codes 2020-02-20 08:30:40 +01:00
ivaosthu
84e0810d64 Some Metrics API cleanups 2020-02-20 08:30:40 +01:00
ivaosthu
f7a89b8223 more tests 2020-02-20 08:30:40 +01:00
ivaosthu
b8014fdddf Server Metrics with Prometheus
Implementation use internal eventBus to enable loose counting in the app.

read more at https://prometheus.io/

Closes #98
2020-02-20 08:30:40 +01:00
ivaosthu
93c37b30c0 Metrics: wrte api documentation 2020-02-20 08:30:40 +01:00
sveisvei
e55378e1c4 Better client informations from the API.
Impelements:
- http://unleash.host.com/api/client/seen-toggles
- http://unleash.host.com/api/metrics/feature-toggles
- http://localhost:4242/api/client/applications
- http://localhost:4242/api/client/applications/:appName
2020-02-20 08:30:40 +01:00
ivaosthu
13a93dcf43 Should not expose legacy fields to whole system 2020-02-20 08:30:40 +01:00
Ivar
3fa930baf0 Added strategies validation when creating/updating toggles 2020-02-20 08:30:39 +01:00
sveisvei
a34ee105fe add count to app state 2020-02-20 08:30:39 +01:00
sveisvei
68ac0c71c9 fix typ0 2020-02-20 08:30:39 +01:00