Commit Graph

1731 Commits

Author SHA1 Message Date
Daan Hoogland f221b9a423 CLOUDSTACK-8656: 30x legacy upgrade code exception messages 2015-08-03 19:35:41 +02:00
Daan Hoogland 8e3b99d0d6 CLOUDSTACK-8656: removed redundant implements 2015-08-03 11:54:35 +02:00
Daan Hoogland 39bf1fed68 CLOUDSTACK-8656: try with resource te eliminate empty catch clauses 2015-08-02 19:48:58 +02:00
Daan Hoogland 04e9083c31 CLOUDSTACK-8656: log messages on exception in legacy sql upgrade code 2015-08-02 15:12:49 +02:00
Daan Hoogland 4e65845789 CLOUDSTACK-8656: removed unused input stream
there was code to close a stream that was never created
2015-08-02 12:58:56 +02:00
Daan Hoogland 89bd6d020f CLOUDSTACK-8656: info on error closing peering channels 2015-08-02 12:55:52 +02:00
Mike Tutkowski 406c2c00b2 Correcting an issue that was introduced with b84093f691 2015-07-30 18:24:58 -06:00
Daan Hoogland e2b6237464 CLOUDSTACK-8656: debug messages on interupted exceptions 2015-07-30 16:03:10 +02:00
Daan Hoogland 85e002b230 CLOUDSTACK-8656: filling empty catch block with info messages
using regexp "catch\s*\(\s*(Exception|Throwable)\s*\w*\)\s*\{\s*\}"
2015-07-30 15:51:52 +02:00
Koushik Das 3be278ed5e CLOUDSTACK-8651: [Browser Based Upload Template] Partially uploaded templates doesn't get cleaned up after the SSVM handling it is destroyed
Fixed template sync code to include templates in 'NotUploaded' and 'UploadInProgress' states along with 'Active'.
2015-07-29 13:40:43 +05:30
Daan Hoogland 3a4d371665 coverity 1147051: trivial db resource leak in endpoint selector should have been nested try catches before try-with-resource beacame available
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-07-27 14:43:11 +02:00
Koushik Das 090db05821 CLOUDSTACK-8666: Put host in Alert state only after alert.wait timeout
Instead of putting the host to Alert state immediately, the investigators should be allowed to run for some time based on alert.wait global config.
At the end of this interval if the host state still cannot be determined then put the host in Alert. Also updated some of the log messages.

This closes #621
2015-07-24 12:16:07 +05:30
Daan Hoogland 8875d7ae15 CLOUDSTACK-7539: coverity regression dead local store
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>

This closes #610
2015-07-22 18:12:52 +02:00
Koushik Das ab7c9e4098 CLOUDSTACK-8655: [Browser Based Upload Volume] Partially uploaded volumes are not getting destroyed as part of storage GC
As part of volume sync, that runs during of SSVM start-up, the volume_store_ref entry was getting deleted. Volume GC relies on this entry to move volume to destroyed state.
Since the entry was getting deleted, GC thread never moved the volume from UploadError/UploadAbandoned to Destroyed. Fix is to not remove the volume_store_ref entry as part
of volume sync and let GC thread handle the clean up.

This closes #611
2015-07-22 19:05:47 +05:30
Daan Hoogland 4f1eb8d6dd coverity 1116711: findLostHost trivial try-with-resource inserted
Signed-off-by: Daan Hoogland <daan@onecht.net>
2015-07-17 13:22:42 +02:00
Daan Hoogland e92e800930 coverity 1116696: iprange adding code cleaned
Signed-off-by: Daan Hoogland <daan@onecht.net>
2015-07-17 13:22:42 +02:00
Daan Hoogland 0c72f7743f Merge branch 'CLOUDSTACK-7539' of https://github.com/DaanHoogland/cloudstack
This closes #572
2015-07-17 12:41:34 +02:00
Daan Hoogland c3d28e1b96 CLOUDSTACK-7539: no return in synchronised block 2015-07-17 11:07:57 +02:00
Daan Hoogland 3c125c0dc1 coverity 1311708: sql exception caught instead of generic (runtime)
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-07-14 13:41:09 +02:00
Daan Hoogland 9681fefaef coverity in upgrade code 1164030: memory upgrade for ssvm 1164031: image store details encryption
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-07-14 11:53:22 +02:00
Koushik Das 9ec2a6c29c CLOUDSTACK-8623: CPVM fails to start after MS is restarted during its initial start-up process
If SSVM cannot be started then the existing entry is removed and a new SSVM gets created. Made similar changes for CPVM as well.
Also cleaned up some log messages in SSVM and CPVM manager code.
2015-07-14 10:55:19 +05:30
Jayapal 140cd7c227 CLOUDSTACK-8324: Fixed config key in multiple places 2015-07-10 09:47:09 +05:30
Jayapal 14d53634a8 CLOUDSTACK-8324: Removed using config drive label from the uservmservice 2015-07-10 09:47:03 +05:30
Jayapal deb694c201 CLOUDSTACK-8324: Added migration changes for config drive 2015-07-10 09:39:27 +05:30
Daan Hoogland 2c7e19faff coverity 1116544: a lot of the same (probably other coverity ids covered as well)
Signed-off-by: Daan Hoogland <daan@onecht.net>
2015-07-09 21:30:24 +02:00
Daan Hoogland f8691b2c69 coverity 1116511 and 1116513: try-with-resource on old upgrade script three issues seen by coverity as two. only one occurence of leakage
Signed-off-by: Daan Hoogland <daan@onecht.net>
2015-07-09 21:30:24 +02:00
Daan Hoogland 3bedeeaacc coverity 1116509: heavy entanglement of prepared statements and result sets hope I got the logic right. this is for very old versions, might be worth phasing out unless someone still uses it.
Signed-off-by: Daan Hoogland <daan@onecht.net>
2015-07-09 21:30:23 +02:00
Daan Hoogland 79709cd490 coverity 1116507: one off old upgrade code trivial fix however
Signed-off-by: Daan Hoogland <daan@onecht.net>
2015-07-09 21:30:23 +02:00
Daan Hoogland 803d6ed7df coverity 1296982: standard prepared statement and result set leakage
Signed-off-by: Daan Hoogland <daan@onecht.net>
2015-07-09 21:30:23 +02:00
Hiroki Ohashi 780816ee9f CLOUDSTACK-7539: [S3] Parallel deployment makes reference count of a cache in nfs secondary staging store negative(-1) 2015-07-09 15:06:31 +02:00
Daan Hoogland bcc8182f2f findbugs: write to static from instance these are the trivial cases of ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD as reported by findbugs
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #539
2015-07-09 15:01:58 +02:00
Daan Hoogland 4ad178e4b1 rats: licenses added
Signed-off-by: Daan Hoogland <daan@onecht.net>

This closes #535
2015-07-07 13:48:20 +02:00
Daan Hoogland d8ab5f3ab8 findbugs: equals unit tests
Signed-off-by: Daan Hoogland <daan@onecht.net>
2015-07-07 13:48:19 +02:00
Daan Hoogland 34629446b6 findbugs equals(obj) implementations go against the contract these are removed from the call into separate calls
Signed-off-by: Daan Hoogland <daan@onecht.net>
2015-07-07 13:48:19 +02:00
Koushik Das f138192c94 CLOUDSTACK-8606: DB performance impacted due to VM sync.
VM sync. generates a lot of queries on vm_instance table with 'instance_name' as filter. Since the field is not
indexed, these kind of queries will impact DB performance. Added an index for instance_name field.

This closes #553
2015-07-03 10:06:48 +05:30
Likitha Shetty 299c07c3e1 CLOUDSTACK-8597. Failed to migrate volume from zone-wide to cluster-wide storage. While live migrating a volume, CS chooses the endpoint to perform the migration by selecting any host that has the storage containing the volume mounted on it. Instead, if the volume is attached to a running VM, the endpoint chosen by CS should be the host that contains the VM.
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>

This closes #541
2015-07-01 12:33:26 +02:00
Rohit Yadav 3ff92e883e database: fix upgrade paths from 4.5.2 to 4.6.0
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-06-29 12:58:47 +02:00
Rohit Yadav 107595a6a5 CLOUDSTACK-8457: SAML auth plugin improvements for production usage
* Move config options to SAML plugin
  This moves all configuration options from Config.java to SAML auth manager. This
  allows us to use the config framework.
* Make SAML2UserAuthenticator validate SAML token in httprequest
* Make logout API use ConfigKeys defined in saml auth manager
* Before doing SAML auth, cleanup local states and cookies
* Fix configurations in 4.5.1 to 4.5.2 upgrade path
* Fail if idp has no sso URL defined
* Add a default set of SAML SP cert for testing purposes
  Now to enable and use saml, one needs to do a deploydb-saml after doing a deploydb
* UI remembers login selections, IDP server

- CLOUDSTACK-8458:
    * On UI show dropdown list of discovered IdPs
    * Support SAML Federation, where there may be more than one IdP
        - New datastructure to hold metadata of SP or IdP
        - Recursive processing of IdP metadata
        - Fix login/logout APIs to get new interface and metadata data structure
        - Add org/contact information to metadata
        - Add new API: listIdps that returns list of all discovered IdPs
        - Refactor and cleanup code and tests

- CLOUDSTACK-8459:
    * Add HTTP-POST binding to SP metadata
    * Authn requests must use either HTTP POST/Artifact binding

- CLOUDSTACK-8461:
    * Use unspecified x509 cert as a fallback encryption/signing key
      In case a IDP's metadata does not clearly say if their certificates need to be
      used as signing or encryption and we don't find that, fallback to use the
      unspecified key itself.

- CLOUDSTACK-8462:
    * SAML Auth plugin should not do authorization
      This removes logic to create user if they don't exist. This strictly now
      assumes that users have been already created/imported/authorized by admins.
      As per SAML v2.0 spec section 4.1.2, the SP provider should create authn requests using
      either HTTP POST or HTTP Artifact binding to transfer the message through a
      user agent (browser in our case). The use of HTTP Redirect was one of the reasons
      why this plugin failed to work for some IdP servers that enforce this.
    * Add new User Source
      By reusing the source field, we can find if a user has been SAML enabled or not.
      The limitation is that, once say a user is imported by LDAP and then SAML
      enabled - they won't be able to use LDAP for authentication
    * UI should allow users to pass in domain they want to log into, though it is
      optional and needed only when a user has accounts across domains with same
      username and authorized IDP server
    * SAML users need to be authorized before they can authenticate
        - New column entity to track saml entity id for a user
        - Reusing source column to check if user is saml enabled or not
        - Add new source types, saml2 and saml2disabled
        - New table saml_token to solve the issue of multiple users across domains and
          to enforce security by tracking authn token and checking the samlresponse for
          the tokens
        - Implement API: authorizeSamlSso to enable/disable saml authentication for a
          user
        - Stubs to implement saml token flushing/expiry

- CLOUDSTACK-8463:
    * Use username attribute specified in global setting
      Use username attribute defined by admin from a global setting
      In case of encrypted assertion/attributes:
      - Decrypt them
      - Check signature if provided to check authenticity of message using IdP's
        public key and SP's private key
      - Loop through attributes to find the username

- CLOUDSTACK-8538:
    * Add new global config for SAML request sig algorithm

- CLOUDSTACK-8539:
    * Add metadata refresh timer task and token expiring
        - Fix domain path and save it to saml_tokens
        - Expire hour old saml tokens
        - Refresh metadata based on timer task
        - Fix unit tests

This closes #489

(cherry picked from commit 20ce346f3a)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

Conflicts:
	client/WEB-INF/classes/resources/messages_hu.properties
	plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/xenbase/CitrixCheckHealthCommandWrapper.java
	plugins/user-authenticators/saml2/src/org/apache/cloudstack/api/command/SAML2LoginAPIAuthenticatorCmd.java
	ui/scripts/ui-custom/login.js
2015-06-29 12:31:51 +02:00
wilderrodrigues ea9db195ed Extracting local variable in order to make the code more readable.
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-06-29 09:59:11 +02:00
wilderrodrigues 4690c3d844 Formatting the code of the AgentManagerImpl class
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-06-29 09:59:10 +02:00
Daan Hoogland 582687fb3f 4.4.4 to 4.5.2 upgrade
Conflicts:
	engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #529
2015-06-26 00:07:44 +02:00
Daan Hoogland 8a8849354c findbugs: masking fields removed 2015-06-24 12:24:12 +02:00
wilderrodrigues 5557ad5588 Offer a getDurationInMillis() method in the Profiler utility class
- New implementation uses nanoseconds. Due to that, the places where the Profiler is used as a Monitor and/or
     a stopwatch will suffer with the difference in the return
   - Also added a getDuration(), which returns the time in nanoseconds in case someone wants to use it instead
   - Added an extra test to check if the getDuration() works fine with nanoseconds
   - Fixed the test that checks the time in milliseconds: I added an error margin to cover the test better

Signed-off-by: Daan Hoogland <daan@onecht.net>
2015-06-24 09:36:40 +02:00
Rafael da Fonseca 53e42fb45e Fix findbugs SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING warning in Upgrade410to420.java
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #505
2015-06-22 10:55:29 +02:00
Rafael da Fonseca 58eac0b49d Fix 2 more findbugs DM_BOXED_PRIMITIVE_FOR_PARSING in Upgrade218to22.java
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #500
2015-06-22 10:49:35 +02:00
Rafael da Fonseca f038a740a5 Fix 2 findbugs occurences of DM_BOXED_PRIMITIVE_FOR_PARSING in Upgrade218to22.java
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #499
2015-06-22 10:48:49 +02:00
Daan Hoogland c45c9bfeef findbugs UC useless condition not sure what findbugs means yet, but this should at least turn both warnings into one.
Signed-off-by: Daan Hoogland <daan@onecht.net>

This closes #490
2015-06-19 15:53:09 +02:00
Sanjay Tripathi 84d4c9bf4c Recurring snapshot issue post upgrade from 3.0.7 to 4.5
This closes #486
2015-06-19 16:03:42 +05:30
Rafael da Fonseca b84093f691 Fix findbugs SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING warning in PrimaryDataStoreDaoImpl.java
Remove trailing spaces that checkstyle complained about

Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #474
2015-06-17 22:46:58 +02:00
Rafael da Fonseca 1407033cc2 Fix findbugs SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING warning in UserVmDaoImpl.java detail field was vulnerable
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #473
2015-06-17 22:38:19 +02:00