Commit Graph

6515 Commits

Author SHA1 Message Date
uboness da15a66d1e Massive refactoring to permission infrastructure
- The Permission class changed such that now there isn't a single `check` method that all permission types must implement. Instead, each permission type has its own (if at all) check method that is relevant to what the permssion is supposed to check.

- Moved the indices resolving logic outside of the indices permission class to the authorization service. Also, the authroization service has all the logic on how to check each one of the indices against a compound/merged permission view over all the user's roles. This fixes a critical bug where if a user had more than one role, its permission wouldn't be checked appropriately (they were checked separately which introduced invalid results)

- Cleaned up and got rid of unused code

- System role is no longer implementing Permission (no need for that)

- Additional tests were added with different users/roles configuration to try an capture such bugs

Fixes elastic/elasticsearch#304

Original commit: elastic/x-pack-elasticsearch@5c9a581019
2014-11-07 14:51:49 +01:00
Martijn van Groningen a6bdb5f572 Test: testing framework requires lucene test jar to be before lucene core jar on the classpath
Original commit: elastic/x-pack-elasticsearch@9b043c9b5b
2014-11-07 14:29:56 +01:00
Martijn van Groningen 434ee83df6 Build: Configure randomizedtesting properly
Original commit: elastic/x-pack-elasticsearch@e7b1a4fb9c
2014-11-07 14:24:56 +01:00
Martijn van Groningen a4dbc7315a Test: Added helper method that checks if an alert has triggered
Original commit: elastic/x-pack-elasticsearch@351d26618f
2014-11-07 13:45:48 +01:00
Martijn van Groningen f2453f53ac Test: Added no master node test
Original commit: elastic/x-pack-elasticsearch@0edeaba3a7
2014-11-07 13:21:15 +01:00
Brian Murphy 387cc6fb76 Add missing license check files.
Forgot to add these on the last commit.

Original commit: elastic/x-pack-elasticsearch@4d205e191d
2014-11-07 10:57:59 +00:00
Brian Murphy 7efeffd2c2 Add License header to all files and javadocs for AlertClientInterface.
This commit adds the license header to all java files and enforces the license check on compile.
It also adds javadocs for all the methods in the AlertClientInterface

Original commit: elastic/x-pack-elasticsearch@2ec6f89b4b
2014-11-07 10:38:43 +00:00
Areek Zillur 814fbb8431 Cleanup: emit debug logs if enabled; remove Comparable interface for ESLicens
Original commit: elastic/x-pack-elasticsearch@c810b337d1
2014-11-06 19:46:17 -05:00
Areek Zillur d8d241b4bb Tests & cleanup:
- transport & service test (remove license functionality)
 - nuked LicenseException class
 - keyPairGenerator tests
 - minor cleanup & restructuring

Original commit: elastic/x-pack-elasticsearch@51acb2f493
2014-11-06 19:26:31 -05:00
Martijn van Groningen 1dc9021fbe Added base alerting test class
Original commit: elastic/x-pack-elasticsearch@a3d258318f
2014-11-06 23:58:30 +01:00
Martijn van Groningen 0f0436e128 Cleaned up rest layer
Original commit: elastic/x-pack-elasticsearch@cdcdc98383
2014-11-06 23:49:50 +01:00
Martijn van Groningen 22cf7f68f4 Make tests work with multiple nodes.
Original commit: elastic/x-pack-elasticsearch@68004e1d6c
2014-11-06 22:52:44 +01:00
Martijn van Groningen 8f0e454ac5 Clear alerts after each test run, so that we don't run into exceptions between wipe indices and node closing.
Improved stop logging

Original commit: elastic/x-pack-elasticsearch@195a4cb75d
2014-11-06 22:15:11 +01:00
Areek Zillur bb929c7470 [TEST] generate sane random licens specs
Original commit: elastic/x-pack-elasticsearch@f83d9d80b6
2014-11-06 15:55:19 -05:00
Martijn van Groningen 5be1c5964c on going work for improving test coverage
Original commit: elastic/x-pack-elasticsearch@1ccb9c9d9b
2014-11-06 21:25:53 +01:00
Areek Zillur 8e9574a925 Make LicensesService tests more robust
- split out LicensesManagerService & LicensesClientService tests
 - add removeLicenses tests
 - other refactoring

Original commit: elastic/x-pack-elasticsearch@a47dc586d7
2014-11-06 14:51:17 -05:00
c-a-m a655a77b3a Wrap logging in if statements. Doc cleanup
This wraps logging statements in if checks.  It also removes from the documentation specific logging examples.

Original commit: elastic/x-pack-elasticsearch@3ca7cdd4f4
2014-11-06 11:24:05 -07:00
c-a-m e526065156 ldap: Adds debugging statements and documentation
This adds debugging statements and debugging documentation to help troubleshoot problems with ldap role establishment.  This also adds ldap profiles for esvm

Original commit: elastic/x-pack-elasticsearch@a1f1cbd830
2014-11-06 11:13:50 -07:00
Areek Zillur 42d47a1bcc make service tests more robust (concurrency fix)
Original commit: elastic/x-pack-elasticsearch@4a031672ba
2014-11-06 12:43:35 -05:00
Alexander Reelsen eaf6636c07 Tests: Use try block to close resources and prevent thread leaks
Original commit: elastic/x-pack-elasticsearch@3c8b4f6ead
2014-11-06 18:31:12 +01:00
Brian Murphy 89dd5e2599 Move alert execution out of scheduler thread.
This commit moves the execution of the alert trigger to the AlertActions queued thread.
Also change the states of AlertActionEntry to include SEARCH_NEEDED and ERROR and remove now uneeded states.
AlertActions now take a TriggerResult instead of an alert action entry.

Original commit: elastic/x-pack-elasticsearch@2b650ca4c1
2014-11-06 13:34:48 +00:00
Brian Murphy f86544497a Remove extraneous methods and change IndexAlertAction.NAME
This commit removes the uneeded addAlert methods in AlertManager and AlertsStore and
also changes the IndexAlertAction.NAME to "indices:data/write/alert/index"

Original commit: elastic/x-pack-elasticsearch@19013dcf3e
2014-11-06 11:14:58 +00:00
Brian Murphy bce97abc1d Refactor and rename transport layer
This commit removes the update action and renames the create action to index.
It also hides the Alert objects behind the interface rather than exposing them.
This means that all interactions should be via BytesReferences.

Original commit: elastic/x-pack-elasticsearch@87ac377d3e
2014-11-06 11:08:57 +00:00
Alexander Reelsen 2f4fb2cf48 Dependencies: Upgrade to Elasticsearch 1.4.0
* Configuring the transport pipeline has changed due to adding profiles in 1.4
* Lots of tests needed to be changed in order to not leave thread pools around
* ApacheDs leaves a thread lingering around, thus a ThreadLeakFilter needed to be added

Original commit: elastic/x-pack-elasticsearch@de35362fc4
2014-11-06 12:03:49 +01:00
Martijn van Groningen 0f78028190 * Update the alert version on each write
* Make AlertStore#addAlert() return a tuple<Alert, IndexResponse>

Original commit: elastic/x-pack-elasticsearch@b2f270caaf
2014-11-06 11:30:52 +01:00
Martijn van Groningen 9c81a2ab87 * Simplified add alert action logic.
* Reduce needed code to index Alert and AlertActionEntry
* Added scroll for loading action needed alert action entries

Original commit: elastic/x-pack-elasticsearch@a7b790ecc4
2014-11-06 09:40:44 +01:00
Areek Zillur abd129fa7a Refactored licensing tools to use CliTool as base
- rewrote licensing tool tests

Original commit: elastic/x-pack-elasticsearch@e5e70a491a
2014-11-05 19:29:00 -05:00
Brian Murphy 6422e8b5d5 Add IndexResponse to Update and Create Alert Responses.
This commit adds the IndexResponse if available to the Update and Create
Alert Response objects.

Original commit: elastic/x-pack-elasticsearch@5fed850c61
2014-11-05 18:08:22 +00:00
Brian Murphy 5d52c374b3 Merge branch 'master' of https://github.com/elasticsearch/elasticsearch-alerts
Original commit: elastic/x-pack-elasticsearch@d91926ebdf
2014-11-05 17:50:54 +00:00
Brian Murphy 41821c39c6 DeleteAlert : Add the delete response to the DeleteAlertResponse
This commit adds the delete response to the DeleteAlertResponse.

Original commit: elastic/x-pack-elasticsearch@a5cc31f321
2014-11-05 17:50:05 +00:00
Areek Zillur 3bf4d2659e Use junit temporaryFolder instead of using deleteOnExit
Original commit: elastic/x-pack-elasticsearch@b437df66f5
2014-11-05 11:03:16 -05:00
Areek Zillur 9b30af3958 Remove LicensingCharset & reformat code
Original commit: elastic/x-pack-elasticsearch@be5dc1c817
2014-11-05 10:53:33 -05:00
Martijn van Groningen b07b0d497d AlertManager#stop() didn't stop, the expected and update was reversed in compareAndSet
Original commit: elastic/x-pack-elasticsearch@5b001af292
2014-11-05 16:13:22 +01:00
Martijn van Groningen 5a957ed678 Introduced dedicated alerting thread pool, which executes alert actions
Original commit: elastic/x-pack-elasticsearch@e49ecb3f7c
2014-11-05 16:08:27 +01:00
Martijn van Groningen 61a28f68e3 Upgraded to ES 1.4.0
Original commit: elastic/x-pack-elasticsearch@6685382a01
2014-11-05 16:06:36 +01:00
Brian Murphy 47a78648df Alerts : Cleanup
This commit :
1. Ensures an alert will run even if the lastFireTime is null (first time we see an alert)
2. Removes the incorrect license that existed in some of the files.
3. Cuts the BasicTest over to use the AlertsClient and deletes the alert at the end of the test
to prevent it running in a race condition.
4. Moves the execute method signatures in AlertsClient to be on a single line.

Original commit: elastic/x-pack-elasticsearch@9c3aec0127
2014-11-05 10:05:17 +00:00
Alexander Reelsen 4903852f48 Packaging: Include build information
Also added a ShieldBuild class to return

* Shield version
* Shield build hash
* Shield build timestamp

Also added a '/_shield' endpoint which returns those fields.

Original commit: elastic/x-pack-elasticsearch@38928d1ef6
2014-11-05 10:28:02 +01:00
Areek Zillur 1eec394f8f Merge branch 'master' into es_integration
Original commit: elastic/x-pack-elasticsearch@e57a626bff
2014-11-04 23:12:25 -05:00
Areek Zillur 7b6afbeb69 minor comments fix
Original commit: elastic/x-pack-elasticsearch@53e5432b55
2014-11-04 23:05:02 -05:00
Areek Zillur 3558ee76f9 remove license
Original commit: elastic/x-pack-elasticsearch@ae67cd82a5
2014-11-04 22:58:45 -05:00
Areek Zillur 3aec0fd1f0 - Fix test concurrency bugs
- Minor test fixes
- LicensesService documentation

Original commit: elastic/x-pack-elasticsearch@ab98ba8a2d
2014-11-04 22:54:27 -05:00
Areek Zillur 93944f27f2 minor fixes
Original commit: elastic/x-pack-elasticsearch@6dae7b4ee6
2014-11-04 17:38:14 -05:00
Areek Zillur 73754767dd short-circuit master notification when registering trial license
Original commit: elastic/x-pack-elasticsearch@877df7705b
2014-11-04 16:51:19 -05:00
Areek Zillur 8007136e63 cleanup tests
Original commit: elastic/x-pack-elasticsearch@b7733b8269
2014-11-04 16:12:42 -05:00
Areek Zillur 97796d3634 minor comment fixes
Original commit: elastic/x-pack-elasticsearch@fbadfc9218
2014-11-04 16:01:01 -05:00
Areek Zillur d9d04fceaf LicensesService:
- Ensure license registration can be called through any stage of consumer plugin life cycle
 - Added randomized plugin integration tests
 - Run test on plugins with different license registration scheme

Original commit: elastic/x-pack-elasticsearch@1cee85943d
2014-11-04 15:48:20 -05:00
Brian Murphy 9a2e594647 Merge branch 'master' of https://github.com/elasticsearch/elasticsearch-alerts
Original commit: elastic/x-pack-elasticsearch@258c047506
2014-11-04 17:24:57 +00:00
Brian Murphy 4f58b9c5ff Alerts : Forgot to add the AlertsClient package.
Sorry.

Original commit: elastic/x-pack-elasticsearch@8231a3845b
2014-11-04 17:24:18 +00:00
Brian Murphy aced6039e9 Merge pull request elastic/elasticsearch#26 from elasticsearch/add-transport-actions
adds the following actions and an AlertsClient with AlertsClientInterface.
CreateAlert : Creates an alert.
UpdateAlert : Updates an existing alert.
DeleteAlert : Deletes an existing alert.
GetAlert : Gets an existing alert.

Original commit: elastic/x-pack-elasticsearch@8638fa7e35
2014-11-04 17:12:39 +00:00
Brian Murphy 9f3f23698f Merge branch 'add-transport-actions' of https://github.com/elasticsearch/elasticsearch-alerts into add-transport-actions
Conflicts:
	src/main/java/org/elasticsearch/alerts/AlertManager.java
	src/main/java/org/elasticsearch/alerts/AlertsStore.java
	src/main/java/org/elasticsearch/alerts/transport/actions/update/TransportUpdateAlertAction.java
	src/main/java/org/elasticsearch/alerts/transport/actions/update/UpdateAlertResponse.java
	src/test/java/org/elasticsearch/alerts/actions/AlertActionsTest.java

Original commit: elastic/x-pack-elasticsearch@3f1b58a2ee
2014-11-04 17:09:40 +00:00