2935 Commits

Author SHA1 Message Date
wilderrodrigues
b54126918b CLOUDSTACK-8590 - Refactoring NiciraNVP resource
- Adding NiciraNvpCreateLogicalRouterCommandWrapper
   - Adding NiciraNvpDeleteLogicalSwitchPortCommandWrapper
   - Adding NiciraNvpFindLogicalSwitchPortCommandWrapper
   - Adding NiciraNvpUpdateLogicalSwitchPortCommandWrapper
   - Decoupling private methods from NiciraNvpResource

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-01 15:04:57 +02:00
wilderrodrigues
b4ce81ab6c CLOUDSTACK-8590 - Refactoring NiciraNVP resource
- Adding NiciraNvpDeleteLogicalSwitchPortCommandWrapper

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-01 15:04:57 +02:00
wilderrodrigues
361ab5ddbd CLOUDSTACK-8590 - Refactoring NiciraNVP resource
- Adding NiciraNvpCreateLogicalSwitchPortCommandWrapper
   - Removing unsued field from NiciraNvpResourceTest

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-01 15:04:57 +02:00
wilderrodrigues
28c1da969d CLOUDSTACK-8590 - Refactoring NiciraNVP resource
- Adding command wrappers NiciraNvpCreateLogicalSwitchCommandWrapper and NiciraNvpDeleteLogicalSwitchCommandWrapper
   - Refactoring the retry mechanism
   - Applying the new retry mechanism to current wrappers and old methods in NiciraNvpResource
   - Adding 2 tests
   - Fixing the testRetries() in NiciraNvpResourceTest class

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-01 15:04:57 +02:00
wilderrodrigues
27c9651b32 CLOUDSTACK-8590 - Refactoring NiciraNVP resource
- Refactoring NiciraNvpResource
   - Added NiciraNvpUtilities and NiciraNvpCreateLogicalSwitchCommandWrapper
   - Removing 1 execute methods form NiciraNvpResource
   - Added 1 unit test

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-01 15:04:56 +02:00
wilderrodrigues
6a51294d19 CLOUDSTACK-8590 - Refactoring NiciraNVP resource
- Refactoring NiciraNvpResource
   - Added NiciraNvpMaintainCommandWrapper
   - Removing 1 execute methods form NiciraNvpResource
   - Added 1 unit test

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-01 15:04:56 +02:00
wilderrodrigues
0d943d5426 CLOUDSTACK-8590 - Refactoring NiciraNVP resource
- Refactoring NiciraNvpResource
   - Added NiciraNvpRequestWrapper
   - Removing 1 execute methods form NiciraNvpResource
   - Added 1 unit test

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-01 15:04:56 +02:00
wilderrodrigues
fc478604e8 CLOUDSTACK-8590 - Refactoring NiciraNVP resource
- Adding the NiciraNvpWrapper
  - This class will keep track of all Wrappers of the Nicira NVP Plugin

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-01 15:04:56 +02:00
Likitha Shetty
9463356ca6 CLOUDSTACK-8600. Upon detaching a disk, delete VM folder if empty.
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #545
2015-07-01 14:53:23 +02:00
jeff
93b201d43a Allow custom command role ACL files on classpath in Static Role API Checker.
This commit has a small refactoring of cloud-plugin-acl-static-role-based
to allow it to read files on the classpath that might have a different name
than "commands.properties". It also allows more than one file to be read from.

Rationale: Third-party plugins may want to keep their API command access level
configuration separate from the main file so as to reduce configuration
maintenance work during packaging and deployments.

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

This closes #354
2015-07-01 14:43:29 +02:00
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
Likitha Shetty
13a98dd196 CLOUDSTACK-8601. VMFS storage added as local storage can be re-added as shared storage.
Fail addition of a VMFS shared storage pool in case it has already been added as local storage in CS.
2015-07-01 10:47:36 +05:30
Rohit Yadav
02c3d14f6e saml2: Use UTF-8 based charset for encoding bytes to strings
This fixes the fingbug issue DM_DEFAULT_ENCODING found in SAMLUtils

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-06-29 17:46:35 +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
527d6ee77b Making possible to update KVM hosts password in the database via the API
- Make sure the doUpdateHostPassword() method returns the result from the answer, not always true
   - Added the LibvirtUpdateHostPasswordCommandWrapper class, which will handle the changes in the KVM agent
     That's will be further implemented in the future. The command will avoid the agent to complain about Unsupported command
   - Added a test to make sure the current implementation of the comment works
     - If changes in the future, it will also require changes. In that way, we make sure nobody will break it

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>

This closes #527
2015-06-29 09:59:12 +02:00
Daan Hoogland
8a8849354c findbugs: masking fields removed 2015-06-24 12:24:12 +02:00
Daan Hoogland
8a99df77b6 findbugs volumeInfo is known to not be null
Signed-off-by: Daan Hoogland <daan@onecht.net>

This closes #515
2015-06-23 23:27:04 +02:00
Daan Hoogland
e8984d16ed findbugs: move assert to a place where it still makes sense
Signed-off-by: Daan Hoogland <daan@onecht.net>
2015-06-23 23:27:03 +02:00
Daan Hoogland
c0a1009740 findbugs: (un)boxing of long from string 2015-06-22 13:18:14 +02:00
Rafael da Fonseca
fe4f0b1a58 Specify all dependency versions in pom.xml
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #497
2015-06-22 13:01:19 +02:00
Rafael da Fonseca
83488e01af Reduce about 1k String objects from being instantiated
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-06-22 13:01:19 +02:00
Rafael da Fonseca
9d19191bc6 Root cause of failure is memory abuse in XenTest.java class ;) This should fix it
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-06-22 13:01:19 +02:00
Rafael da Fonseca
301a7b9a7e Specify all external dependencies in pom Upgrade to lang3 and change usage of deprecated xmlparse method
Add another missing dependency

Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-06-22 13:01:19 +02:00
Rafael da Fonseca
1603f722c4 Cleanup some lint checker warning in base classes
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-06-22 13:01:18 +02:00
Rafael da Fonseca
540b163cfc Resolve unsafe cast warnings reported by lint checker Add some debug config to compiler plugin
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-06-22 13:01:18 +02:00
Rafael da Fonseca
b929db1f1a Fix findbugs DM_BOXED_PRIMITIVE_FOR_PARSING warning in ElastistorPrimaryDataStoreLifeCycle.java
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #503
2015-06-22 10:54:55 +02:00
Rafael da Fonseca
a17852aaf4 Fix findbugs DM_BOXED_PRIMITIVE_FOR_PARSING warning in ElastistorUtil.java
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #504
2015-06-22 10:54:19 +02:00
Rafael da Fonseca
0d8c64ea56 Fix findbugs DM_BOXED_PRIMITIVE_FOR_PARSING in OvmResourceBase.java
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #502
2015-06-22 10:50:48 +02:00
Rafael da Fonseca
dc359c505e Fix findbugs DM_BOXED_PRIMITIVE_FOR_PARSING in BareMetalResourceBase.java
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #501
2015-06-22 10:50:12 +02:00
Daan Hoogland
bbb165a037 findbugs: use preferred encoding explicitly 2015-06-20 10:36:15 +02:00
Daan Hoogland
9eff27a080 findbugs: static member should be final
Signed-off-by: Daan Hoogland <daan@onecht.net>

This closes #495
2015-06-20 00:57:59 +02:00
Daan Hoogland
871ba9c521 findbugs: ignored return value should have been returned down stack
Signed-off-by: Daan Hoogland <daan@onecht.net>

This closes #494
2015-06-20 00:57:01 +02:00
Daan Hoogland
e3407a3939 findbugs: encoding using preferred Charset 2015-06-19 23:03:05 +02:00
Sanjay Tripathi
9044a02d9a VM Snapshot Usage for DATA disk is reported as the size of the DATA disk instead of the actual snapshot size.
This closes #485
2015-06-19 15:55:21 +05:30
Daan Hoogland
0952580096 findbugs: try-with-resource to circumvent not handling an exception on
close
2015-06-17 12:41:04 +02:00
Daan Hoogland
6da6c5f762 findbugs: log unhandled exception as warning 2015-06-17 12:35:39 +02:00
Sanjay Tripathi
d702b63bfb CLOUDSTACK-8569: The latter snapshot export for the same volume will fail is 2 snapshot exports are queued
This closes #469
2015-06-17 15:27:03 +05:30
Sanjay Tripathi
47278556f5 CLOUDSTACK-8567 Migrating primary storage causes name_label field to blank.
This closes #468
2015-06-17 14:46:51 +05:30
Daan Hoogland
41c1fddaee findbugs: better message and fallback to defaultCharset 2015-06-16 11:57:15 +02:00
Rafael da Fonseca
0851e4e54b Catch encoding exception
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #464
2015-06-16 11:24:51 +02:00
Rafael da Fonseca
9f2ebdf443 Fix findbugs encoding issue in VmwareStorageProcessor.java Any encoding would do fine as it's just used to generate a UUID. Sticking with UTF-8 for consistency
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #460
2015-06-16 08:56:33 +02:00
Rafael da Fonseca
9bb920af65 Fix findbugs warning in VmwareStorageManagerImpl.java Any encoding would do fine as it's just used to generate a UUID. Sticking with UTF-8 for consistency
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #461
2015-06-16 08:53:56 +02:00
Rafael da Fonseca
3d48af41a8 Fix findbugs encoding issue in VmwareResource.java Key file should be UTF-8 encoded in VR
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #462
2015-06-16 08:51:54 +02:00
Rafael da Fonseca
34d097f349 Fix 4 findbugs warnings in JuniperSrxResource Data should be read and written in UTF-8 to the SRX Buffers were being used for reading but not for writing, PrintWriter was auto-flushing and code was explicitly flushing again, causing unnecessary operation to be performed.
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #399
2015-06-15 21:49:43 +03:00
Wido den Hollander
4b4c52ea77 CLOUDSTACK-8560: Stat the resulting image after copying from template and return the size
This way we update the DB with the actual size of the disk after deployment from template
2015-06-15 17:55:56 +02:00
Rafael da Fonseca
9511831f0a Fix 2 findbugs warnings in ElastistorUtil.java Unnecessary boxing/unboxing of long value
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #429
2015-06-15 12:09:47 +03:00
Rafael da Fonseca
ea31a674a4 Fix findbugs warning in ElastistorPrimaryDataStoreLifeCycle.java Unnecessary boxing/unboxing of primitive value
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #428
2015-06-15 12:09:45 +03:00
Rafael da Fonseca
6f330f7ab6 Fix findbugs warning in PaloAltoResource.java Unnecessary boxing/unboxing of primitive value
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #427
2015-06-15 12:09:43 +03:00
Rafael da Fonseca
1494487f72 Fix findbugs warning in NetscalerResource.java Unnecessary boxing/unboxing of primitive value
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #426
2015-06-15 12:09:41 +03:00