1709 Commits

Author SHA1 Message Date
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
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 20ce346f3acb794b08a51841bab2188d426bf7dc)
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
Daan Hoogland
9f02531212 CLOUDSTACK-8537 add check for unique public key and account on ssh keypair registration
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-06-17 20:47:57 +02:00
Rafael da Fonseca
ce506000cd Re-run travis
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #453
2015-06-17 12:14:31 +02:00
Rafael da Fonseca
4a333e452a Fix findbugs RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE in AgentManagerImpl.java Assert isn't used in prod runtime
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-06-17 12:14:31 +02:00
Rafael da Fonseca
acab743aa1 Re-run travis
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #452
2015-06-17 12:13:46 +02:00
Rafael da Fonseca
380ac0cf24 Fix findbugs RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE in ServiceOfferingVO.java Assert isn't used in prod runtime
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-06-17 12:13:46 +02:00
Rafael da Fonseca
5a3e57e6b2 Re-run travis
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #450
2015-06-17 12:12:41 +02:00
Rafael da Fonseca
b3d49d9135 Fix findbugs RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE in DataCenterVO.java Assert isn't used in prod runtime
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-06-17 12:12:41 +02:00
Rafael da Fonseca
eaa4eba74d Fix findbugs RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE in EngineHostVO.java Assert isn't used in prod runtime, null is checked in method
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #448
2015-06-17 12:10:45 +02:00
Rafael da Fonseca
a2129b2940 Fix findbugs RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE in VmWorkJobDispatcher.java Assert isn't used in prod runtime, null is properly checked in method
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #446
2015-06-17 12:08:19 +02:00
Rafael da Fonseca
d056c3d279 Fix findbugs RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE in VirtualMachineManagerImpl.java Removed two unnecessary null checks as this piece of code will only run if answer is not null, as satified in condition stated in line #1253
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #445
2015-06-17 12:07:54 +02:00
Rafael da Fonseca
874aa8d15a Fix findbugs RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE in HostVO.java Assert isn't used in prod runtime
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #451
2015-06-15 12:28:00 +03:00
Rafael da Fonseca
0dc25905d2 Fix findbugs RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE in NetworkOrchestrator.java If answer is null, method will throw ConnectionException in line 3016 as satisfied by condition stated in line 3014
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #449
2015-06-15 12:27:54 +03:00
Rafael da Fonseca
1b79a8e1d6 Fix findbugs RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE in EngineDataCenterVO.java Assert isn't used in prod runtime, null is checked in method
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #447
2015-06-15 12:24:04 +03:00
Rafael da Fonseca
0f4aac7359 Fix findbugs RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE in AgentManagerImpl.java Assert isn't used in runtime, null is properly checked in method
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #444
2015-06-15 12:17:53 +03:00
Rafael da Fonseca
117870c121 Fix 3 findbugs SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING warnings in Upgrade410to420.java There was no risk of sql injection here, nor any need to use PreparedStatement, still this fixes the warnings
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #443
2015-06-15 12:17:51 +03:00
Rafael da Fonseca
4eaa613a0b Fix findbugs SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING warning in Upgrade30xBase.java There was no risk of sql injection here, nor any need to use PreparedStatement, still, this fixes the warning
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #442
2015-06-15 12:17:49 +03:00
Rafael da Fonseca
869cc0c9f2 Fix findbugs SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING warning in Upgrade2214to30.java There was no risk of sql injection here, nor any need to use PreparedStatement, still this fixes the warninG
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #441
2015-06-15 12:17:47 +03:00
Rafael da Fonseca
e409bc3e60 Fix findbugs warning in Upgrade421to430.java Was creating Integer to assign to int
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #419
2015-06-15 12:09:27 +03:00
Rafael da Fonseca
a299674831 Fix 4 findbugs warnings in Upgrade218to22.java Was creating boxed Integers when only int is required
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #418
2015-06-15 12:09:26 +03:00
wilderrodrigues
c3b4c7a9cf Coverity issue 1116509 - Assigning the the new returned ResultSet to the rs variable in order to get it closed in the finally block
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-06-04 12:34:04 +02:00
wilderrodrigues
abe0990259 Formatting the code - Adding final modifier and indenting the code
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-06-04 12:34:04 +02:00
Rajani Karuturi
b31b8425df CLOUDSTACK-8525: NPE while updating the state of the volume after deletion
The volume is already deleted (may be by the cleanup thread) and hence
the NPE. Added a not null check for the volumevo and returning false
from the state transition

This closes #321
2015-06-03 11:45:02 +05:30