ivaosthu
4ce23e4f7f
chore: move metrics-helper.js
2020-02-20 08:34:27 +01:00
Moritz Johner
d0f57a68b2
feat: add db query latency metrics ( #473 )
...
* feat: add db metrics
Signed-off-by: Moritz Johner <beller.moritz@googlemail.com>
* fix: use base unit
Signed-off-by: Moritz Johner <beller.moritz@googlemail.com>
2020-02-20 08:34:27 +01:00
ivaosthu
f4667fa767
chore: add a test to verify eventHook registration
2020-02-20 08:34:26 +01:00
Ran Magen
d917e8018f
feat: add option and functionality that allows a user to hook into feature mutations ( #457 )
...
* Add option and functionality that allows a user to hook into feature mutations.
* Fix function argument to include the entire event.
2020-02-20 08:34:26 +01:00
Ran Magen
79741f78e5
fix: Add DATABASE_URL_FILE for loading a db url from a file ( #455 )
2020-02-20 08:34:26 +01:00
Ivar Conradi Østhus
8cb93920d9
chore: remove console.log in test
2020-02-20 08:34:25 +01:00
Ivar Conradi Østhus
62b97ca828
fix: none authentication should have a mock user ( #449 )
...
This also fix the bug introduces where authentication mode triggers readOnly mode in the UI.
2020-02-20 08:34:25 +01:00
ivaosthu
8ce662e8a9
chore: Make options more testable
2020-02-20 08:34:25 +01:00
ivaosthu
70911e4013
chore: use undefined instead of null
2020-02-20 08:34:25 +01:00
Thinh Tran
484b10029d
feat: Separate DATABASE_URL to multiple DATABASE_* variable ( #437 )
...
* Support construct database by multiple env variable
* fix typo for test
* Add small change for passord and support ssl
* consider ssl should be true always
2020-02-20 08:34:24 +01:00
ivaosthu
9c32a28597
fix: Application fields should be optional.
2020-02-20 08:34:24 +01:00
ivaosthu
06186a7638
fix: should be more allow about empty metrics
2020-02-20 08:34:24 +01:00
ivaosthu
ccaab0c47b
fix: LogProvider as option injected to unleash.
...
Instead of instructing users to do static calls
in to Unleash, she should instead be allwed to
specify the log provider as an option to Unleash.
This commit introduces the "getLogger" option,
a function responsible for creating a logger.
2020-02-20 08:34:24 +01:00
ivaosthu
09a9212dca
fix: Session cookie should set path to baseUriPath
2020-02-20 08:34:23 +01:00
ivaosthu
c66545e11e
fix(package): update mime to version 2.4.1
...
closes #418
2020-02-20 08:34:23 +01:00
ivaosthu
ccce6056dd
Fix: Add support for IPC connections.
...
Read this for more details:
https://nodejs.org/api/net.html#net_identifying_paths_for_ipc_connections
2020-02-20 08:34:23 +01:00
Ivar Conradi Østhus
42cfd93820
fix: trigger actual logout on request
2020-02-20 08:34:22 +01:00
Benjamin Ludewig
e11e036d2d
fix: import should use mime.lookup() for filename
2020-02-20 08:34:22 +01:00
Benjamin Ludewig
a06d2c04bb
Refactored state-service, schemas, added e2e tests #395
2020-02-20 08:34:22 +01:00
Benjamin Ludewig
9065c5ee88
feat: Added import & export through stateService #395
2020-02-20 08:34:22 +01:00
ivaosthu
bb396b6c62
feat: Add customizable ui config
2020-02-20 08:34:22 +01:00
ivaosthu
f5d4f618ae
fix: Application list should be alphabetically sorted
...
closes #403
2020-02-20 08:34:21 +01:00
ivaosthu
1c1b1edd83
fix: Add explicit endpoints for toggle on/off
...
closes #394
2020-02-20 08:34:21 +01:00
ivaosthu
e14d7fc5f0
fix: SimpleAuthentication should work with custom basePaths
2020-02-20 08:34:21 +01:00
ivaosthu
227c6c2e7a
fix: Metrics poller should start even if inital fetch fails.
...
Currently if the intial metrics-fetch fails unleash will not
setup a metrics-poller. This fix ensures that the metrics
poller will start regardless of whether the inital fetch
fails or succeeds.
closes #396
2020-02-20 08:34:21 +01:00
ivaosthu
c3798d5858
fix: Variants should be allowed to be 'null'
2020-02-20 08:34:21 +01:00
ivaosthu
f6af62528b
fix: metric-schema for variant counts
2020-02-20 08:34:20 +01:00
ivaosthu
f51500ec78
fix: override field changed name to contextName
2020-02-20 08:34:20 +01:00
ivaosthu
df5ef09008
feat: Add suppport for variant overrides
2020-02-20 08:34:20 +01:00
sveisvei
a95a2b0973
fix: Gracefully handle variant metrics
2020-02-20 08:34:20 +01:00
ivaosthu
c25e994322
fix: Update variant protocol
2020-02-20 08:34:20 +01:00
ivaosthu
82bf748341
fix: variant tests more stable
2020-02-20 08:34:20 +01:00
Juan Hoyos
3623052c36
feat: Added feature toggle variants
2020-02-20 08:34:20 +01:00
ivaosthu
81c33312a2
fix: Critical bugfix 'databaseSchema' not defaulting to 'public'
2020-02-20 08:34:19 +01:00
ivaosthu
8b9f9dbd2c
fix: Database migrator does use the databaseSchema option
...
closes #387
2020-02-20 08:34:19 +01:00
Benjamin Ludewig
175208c105
Refactored controllers, moved checkPermission to permission-checker.js middleware
2020-02-20 08:34:19 +01:00
Benjamin Ludewig
b38da68d28
Don't expose user permissions when extendedPermissions is disabled, cleanup controller.js
2020-02-20 08:34:19 +01:00
Benjamin Ludewig
abe4f8cf16
Use full name instead of perms, 403 error message now includes expected permission
2020-02-20 08:34:19 +01:00
Benjamin Ludewig
e81f4a01eb
Removed REVIVE_FEATURE permission in favor of UPDATE_FEATURE
2020-02-20 08:34:19 +01:00
Benjamin Ludewig
df7509e381
feature: Add action specific user permissions
2020-02-20 08:34:19 +01:00
ivaosthu
e256db29a5
fix(http-status): Client errors should use 400 status codes
2020-02-20 08:34:19 +01:00
ivaosthu
cdf623e70f
chore: Upgrade ava to 1.0.1
2020-02-20 08:34:18 +01:00
ivaosthu
d5db78d140
chore(modernize): Use joi for url-friendly name validation
2020-02-20 08:34:18 +01:00
ivaosthu
62e6d1075a
chore(modernize): remove express-validator
2020-02-20 08:34:18 +01:00
ivaosthu
3c8e51118e
chore(modernize): Admin cleanup error-handlers
2020-02-20 08:34:18 +01:00
ivaosthu
ed14e3ed8b
chore(modernize): Admin StrategyController
2020-02-20 08:34:18 +01:00
ivaosthu
984bb14351
fix(strategy): Correct error message
2020-02-20 08:34:18 +01:00
ivaosthu
738c26fd62
chore(modernize): Admin MetricsController
2020-02-20 08:34:18 +01:00
ivaosthu
a2c330f92e
chore(modernize): UserController
2020-02-20 08:34:17 +01:00
ivaosthu
a8de54dd73
chore(modernize): Use base controller for all client controllers
2020-02-20 08:34:17 +01:00
ivaosthu
39bc265daf
chore(modernize): Use joi schema-validation in FeatureController
2020-02-20 08:34:17 +01:00
ivaosthu
e285f39bcb
chore(modernize): Admin FeatureController
2020-02-20 08:34:17 +01:00
ivaosthu
4a98d718cf
chore(modernize): Spin out base class for Controllers
2020-02-20 08:34:17 +01:00
ivaosthu
be5cf15cf8
chore(modernize): Admin ArchiveController
2020-02-20 08:34:17 +01:00
ivaosthu
a7382419d5
chore(modernize): Remove unused files
2020-02-20 08:34:17 +01:00
ivaosthu
307b68a67e
chore(modernize): cleanup api-def
2020-02-20 08:34:17 +01:00
ivaosthu
e4cfd54529
chore: Simplify client-controller constructor
2020-02-20 08:34:17 +01:00
ivaosthu
8ca233a722
chore(modernize): Modernize ClientRegisterController
2020-02-20 08:34:17 +01:00
ivaosthu
80a5d5c581
chore(modernize): Modernize ClientMetricsController
2020-02-20 08:34:17 +01:00
ivaosthu
8913c4fac5
chore(modernize): Modernize ClientIndexController
2020-02-20 08:34:17 +01:00
ivaosthu
461011b894
chore(modernize): Modernize FeaturesController
2020-02-20 08:34:17 +01:00
ivaosthu
2dde9c4b95
chore(modernize): Modernize IndexController
2020-02-20 08:34:17 +01:00
ivaosthu
b870e209a9
chore(modernize): Modernize BackstageController
2020-02-20 08:34:17 +01:00
ivaosthu
3903015cbb
chore(modernize): Modernize HealthCheckController
2020-02-20 08:34:17 +01:00
Benjamin Ludewig
822d718a9b
Add prometheus compatible feature metrics endpoint
2020-02-20 08:34:16 +01:00
Ivar Conradi Østhus
3a2771bd75
chore: fix lint
2020-02-20 08:34:15 +01:00
Ivar Conradi Østhus
c0a6ae64e0
chore: fix linting
2020-02-20 08:34:15 +01:00
ivaosthu
ddad9e27a3
fix(clientApi): Add namePrefix paramter to /api/client/features
...
Allows the client to limit the response to name with the given prefix.
2020-02-20 08:34:14 +01:00
Simen Bekkhus
0bf834a4f2
chore: upgrade prettier
...
Closes #345
2020-02-20 08:34:13 +01:00
ivaosthu
3c40cf2f2e
fix(gzip): Add gzip support
2020-02-20 08:34:13 +01:00
ivaosthu
ad171e753e
fix(log4js): Upgrade to log4js 3.0.3 and fix configuration
2020-02-20 08:34:12 +01:00
Ivar Conradi Østhus
054e87cf4a
Include user information on revive
...
Closes #327
2020-02-20 08:34:11 +01:00
ivaosthu
bc359c2b82
feat(metrics): Expose toggle updates to prometheus
...
closes #323
2020-02-20 08:34:11 +01:00
ivaosthu
da68926086
chore(package.json): Bump all dev-dependencies
2020-02-20 08:34:11 +01:00
Ivar Conradi Østhus
4c73d279aa
fix(migration): Unleash should not start if migration fails.
...
Closes #320
2020-02-20 08:34:10 +01:00
Ivar Conradi Østhus
e0f2866be6
Use HTTP_HOST env variable as default host address
2020-02-20 08:34:10 +01:00
Ivar Conradi Østhus
d8f8bf6fd9
Clean up using servers listening and error events
2020-02-20 08:34:10 +01:00
Ivar Conradi Østhus
d757993432
Use options object with server.listen
2020-02-20 08:34:10 +01:00
Ivar Conradi Østhus
378544f326
createApp should wait for server.listen callback
2020-02-20 08:34:10 +01:00
Ivar Conradi Østhus
4f808f13eb
feat(bind): Added option to bind to http address.
...
Closes #318
2020-02-20 08:34:10 +01:00
Simen Bekkhus
027e2814a8
refactor: use body-parser bundled with express ( #304 )
2020-02-20 08:34:09 +01:00
Ivar Conradi Østhus
67ec4b58fe
fix(store): DB should not override createdAt if set.
2020-02-20 08:34:08 +01:00
ivaosthu
c544f81fba
Bugfix: more informative name validation errors
...
Will know tell the user if the toggle name is already
in use by an active feature toggle or an archived toggle.
Also brings lates unleash-frontend fix, which prevents an
invalid form from submitting.
closes : #290 , #291
2020-02-20 08:34:07 +01:00
ivaosthu
d7c1360cc7
A bit of house-keeping
2020-02-20 08:34:07 +01:00
ivaosthu
b3704666bc
Add sign-out route #288
2020-02-20 08:34:07 +01:00
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