3267 Commits

Author SHA1 Message Date
Daan Hoogland
4bba499412 rats: licenses missing 2015-07-06 17:04:26 +02:00
Daan Hoogland
a71c985223 findbugs: added test for getServiceProvider of CreateVpcOffering api
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #538
2015-07-06 16:22:19 +02:00
Daan Hoogland
e34389a612 findbugs: impossible cast(s) fixed by changing field types
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-07-06 16:22:19 +02:00
wilderrodrigues
6c92ccf8d1 CLOUDSTACK-8607 - Refactoring attribute name
- Refactoring attribute name from shouldUpdateHost to updatePasswdOnHost
   - Fixing ApiConstants class because it had an error in the constant name
2015-07-03 11:43:56 +02:00
wilderrodrigues
a74971df06 CLOUDSTACK-8607 - Adding shouldUpdateHost flag
- Make sure doUpdateHostPassword() doesn't get called if flag is set to false
   - Do not update XenServer hosts if the cluster ID is not informed
2015-07-02 11:12:08 +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
03dd34039a Decouple the use of updateHostPassword
- The code was hard to maintain because updating a host or all the hosts in a cluster was handled in the same method
   - Created updateHost and updateCluster password in both ResourceManager and ManagementServer interfaces/classes
   - The chck for whihc method to use is done in the API level
   - Started adding the support for KVM host passwd update

No API changes are needed and it will be backwards compatible.

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-06-29 09:59:10 +02:00
wilderrodrigues
305ce786e0 Formatting UpdateHostPasswordCmd class
- Needs to be formatted before applying other changes

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-06-29 09:59:09 +02:00
wilderrodrigues
4e6fd0f17f Formatting the code of the ManagementService class
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-06-29 09:59:09 +02:00
Daan Hoogland
edfe6f4d4f findbugs Boolean return null in getter not in is-query
Signed-off-by: Daan Hoogland <daan@onecht.net>

This closes #534
2015-06-28 12:41:44 +02:00
Daan Hoogland
f5847147c0 findbugs: serializable fields
Signed-off-by: Daan Hoogland <daan@onecht.net>

This closes #533
2015-06-26 15:11:16 +02:00
Rene Moser
af902fd9d9 CLOUDSTACK-8578: implement state=present for listing only non-destroyed VMs
So the behavior before this fix can be used in a proper way.

Signed-off-by: Daan Hoogland <daan@onecht.net>

This closes #513
2015-06-24 20:21:33 +02:00
Daan Hoogland
55c1d9f3fa findbugs: fields of serializable made serializable
Signed-off-by: Daan Hoogland <daan@onecht.net>

This closes #522
2015-06-24 20:20:12 +02:00
Rafael da Fonseca
dc40f6117b Fix findbugs DM_BOXED_PRIMITIVE_FOR_PARSING warning in DeployVMCmd.java
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #498
2015-06-22 10:47:48 +02:00
Rafael da Fonseca
ae328a6588 Fix 2 findbugs STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCE warnings in BaseCmd.java Dateformat objects are not threadsafe and should be defined as instance variables Both INPUT_FORMAT and NEW_INPUT_FORMAT are only used in ParamProcessWorker.java and doesn't makes it more readable to declare in own class
Add missing import statement

Removed extraneous file

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

This closes #457
2015-06-15 16:32:30 +02:00
Rafael da Fonseca
d0a494b71b Fix findbugs DM_BOXED_PRIMITIVE_FOR_PARSING in DeployVMCmd.java Was creating Long to assign to long
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #417
2015-06-15 12:09:24 +03:00
Rafael da Fonseca
16baa1289b Remove unused imports to fix checkstyle warnings
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #414
2015-06-15 12:09:19 +03:00
Rafael da Fonseca
9c4162ac7f Fix 2 findbugs ClassCastExceptions getDetails() isn't called anywhere in the code, either way, implementation is wrong since details is a Map\<String, String\> and not a Map\<String, Map\<String,String\>\> If this piece of could would get run, it would just fail trying to cast String to HashMap\<String,String\> Removed nonsense comment about casting a Collection to a Map obviously giving exception
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-06-15 12:09:18 +03:00
Rafael da Fonseca
a7a39a608c Remove unused imports to fix checkstyle warnings
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #413
2015-06-15 12:09:17 +03:00
Rafael da Fonseca
96d6aaa293 Fix findbugs ClassCastException in UpgradeSystemVMCmd.java getDetails() isn't called anywhere in the code, either way, implementation is wrong since details is a Map<String, String> and not a Map<String, Map<String,String>> If this piece of could would get run, it would just fail trying to cast String to HashMap<String,String> in line 83
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-06-15 12:09:16 +03:00
Rafael da Fonseca
8634fe5cf5 Remove unused imports to fix checkstyle warnings
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #412
2015-06-15 12:09:15 +03:00
Rafael da Fonseca
31a4f0ad6b Fix findbugs ClassCastException in ScaleSystemVMCmd.java getDetails() isn't called anywhere in the code, either way, implementation is wrong since details is a Map<String, String> and not a Map<String, Map<String,String>> If this piece of could would get run, it would just fail trying to cast String to Map<String,String>
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-06-15 12:09:14 +03:00
René Moser
666263e84d template, api: fix format desc, add OVA format
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #331
2015-05-29 21:02:03 +02:00
Jayapal
69ea932897 CLOUDSTACK-8324: Config drive changes for xenserver 2015-05-28 15:51:50 +05:30
Jayapal
e407986183 CLOUDSTACK-8324: Added config drive support for xenserver 2015-05-28 15:51:50 +05:30
Jayapal
733ac2b728 CLOUDSTACK-8324: Added vm ip fetch logic 2015-05-28 15:42:08 +05:30
Jayapal
70934e8c1a CLOUDSTACK-8324: Skip ip allocation for external dhcp 2015-05-28 15:42:07 +05:30
Milamber
87d4086a64 CLOUDSTACK-6181 Specify GB for the value of rootdisksize parameter. Add some Bytes/GB for log or exception messages. Fix Gb->GB. 2015-05-23 17:52:21 +01:00
Rohit Yadav
1c81b241e7 CLOUDSTACK-8505: Don't allow non-POST requests for default login API
We add a new contract to pass Http request to authentication plugin system. In
the default login API, we disallow non-POST requests.

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

Conflicts:
	api/src/org/apache/cloudstack/api/auth/APIAuthenticator.java
	plugins/user-authenticators/saml2/src/org/apache/cloudstack/api/command/GetServiceProviderMetaDataCmd.java
	plugins/user-authenticators/saml2/src/org/apache/cloudstack/api/command/SAML2LoginAPIAuthenticatorCmd.java
	plugins/user-authenticators/saml2/src/org/apache/cloudstack/api/command/SAML2LogoutAPIAuthenticatorCmd.java
	plugins/user-authenticators/saml2/test/org/apache/cloudstack/api/command/GetServiceProviderMetaDataCmdTest.java
	plugins/user-authenticators/saml2/test/org/apache/cloudstack/api/command/SAML2LoginAPIAuthenticatorCmdTest.java
	plugins/user-authenticators/saml2/test/org/apache/cloudstack/api/command/SAML2LogoutAPIAuthenticatorCmdTest.java
	server/src/com/cloud/api/ApiServlet.java
	server/src/com/cloud/api/auth/DefaultLoginAPIAuthenticatorCmd.java
	server/src/com/cloud/api/auth/DefaultLogoutAPIAuthenticatorCmd.java
	server/test/com/cloud/api/ApiServletTest.java
2015-05-22 11:44:34 +01:00
Koushik Das
1cd2e9bc44 Merge branch 'CLOUDSTACK-8301' of https://github.com/apache/cloudstack 2015-05-22 09:47:59 +05:30
Rene Moser
84266b1c72 api: network: fix and reformat descriptions
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #275
2015-05-21 17:49:19 +02:00
Rene Moser
c1fbb7821a api: loadbalancer: fix and reformat descriptions
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-05-21 17:49:18 +02:00
Rene Moser
a1f58c48ec api: iso: fix and reformat descriptions
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-05-21 17:49:18 +02:00
Rene Moser
897c73867d api: firewall: fix and reformat descriptions
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-05-21 17:49:18 +02:00
Rene Moser
f17ab71bdf api: affinitygroup: fix and reformat descriptions
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-05-21 17:49:18 +02:00
Rene Moser
4c65acfff7 api: address: fix and reformat descriptions
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-05-21 17:49:18 +02:00
Rene Moser
68e867f0c6 api: account: fix and reformat descriptions
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-05-21 17:49:18 +02:00
Rene Moser
5cd35a2237 fix typos balacner -> balancer
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-05-21 17:49:17 +02:00
Rene Moser
23a44d6417 instanceGroupResponse: fix description
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-05-21 17:49:17 +02:00
Rene Moser
3824d997d6 queryService: fix style, remove public statement on interfaces
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-05-21 17:49:17 +02:00
Rene Moser
c43e4db4e0 ListFirewallEgressRulesCmd: add interfaces and minor cleanup
This commit does not implement new functionality:

* Fixes duplicate parameter in API docs.
* Fixes a bunch of typos.
* Add interfaces to make it easier for the FirewallService interface.

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

This closes #249
2015-05-20 17:00:08 +01:00
Koushik Das
3f7e31ed05 CLOUDSTACK-8301: Enable configuring local storage use for system VMs at zone level
Made system.vm.use.local.storage a zone level configuration.
2015-05-19 21:32:14 +05:30
Devdeep Singh
a99c9d0e68 Implementation for the ability to disable a storage pool for provisioning
... of new volumes. Following changes are implemented 1. Disable or enable a pool with the
updateStoragePool api. A new 'enabled' parameter added for the same. 2. When a
pool is disabled the state of the pool is updated to 'Disabled' in the db. On
enabling it is updated back to 'Up'. Alert is raised when a pool is disabled or
enabled. 3. Updated other storage providers to also honour the disabled state.
4. A disabled pool is skipped by allocators for provisioing of new volumes. 5.
Since the allocators skip a disabled pool for provisioning of volumes, the
volumes are also not listed as a destination for volume migration.

FS: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Disabling+Storage+Pool+for+Provisioning

This closes #257

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-05-19 11:16:49 +01:00
Rene Moser
e8f8e0e3f2 listPortForwardingRules: fix typo in doc
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #248
2015-05-13 15:43:53 +02:00
Rohit Yadav
1840805aab server: Introduce Unknown Status to be used in AbstractInvestigatorImpl
The PR #211 introduced changes where the abstract investigator testIpAddress()
would return other Status, which previously only returned null, Up or Down. In
this patch we introduce a new Status "Unknown" that replaces null's semantics.

The important changes #211 introduced was the debugging statements as semantically
the changes would work same as the consumers of testIpAddress() method only used
if returned values were Up or Down and in other cases (null, Alert etc) it would
simply continue to loop through the resources being investigated.

Keeping the debug logs, this commit only replaces the previously returned null
values with Status.Unknown and fixed the debug statements to reflect the same.
In case of trapped exceptions too, we return Unknown status but log the exception
we trapped.

server: add null assertions and remove dead code with testIpAddress usage

This closes #222

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 7a1cb28c9f548ac185dcb7c59eb2fadb7d550718)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-05-03 15:16:04 +02:00
Rohit Yadav
df3dea58a2 CLOUDSTACK-6139: Fix regression, allow zone level systemvm localstorage config
From b3f18e7d74a0f09db9977554a6c7648b7edbc33d, the zone level systemvm local
storage setting never worked as it needed to be moved to config depot.

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

Conflicts:
	plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
	server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
2015-05-01 15:27:40 +02:00
Anshul Gangwar
2133c302f4 CLOUDSTACK-8413: Fixed resource tags on disk are lost when migrate to another storage
During cold volume migration we are duplicating volume entry in volumes table.
When migration is complete, we update the uuid of new entry and expunge the older entry.
This results in removal of resource tags on volume as its resource id still pointing to older volume.
As part of fix while updating uuid for volume, we are updating resource_id for tags also.

This closes #194
2015-04-30 14:34:20 +05:30
Rajani Karuturi
0b8355920e Merge branch 'volume-upload' into master
This closes #206
2015-04-29 11:12:53 +05:30
Ilia Shakitko
fe29998938 GetUsageRecordsCmd - NewInputFormat for START_DATE and END_DATE (with time; backward capabile)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-04-24 11:34:51 +02:00
Rohit Yadav
79a46fe0b4 CLOUDSTACK-8399: Allow changing hvm flag in updateTemplate API
This allows changing the hvm flag for a template after the template has been
registered.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 3e8b12bbb12554baf7ba2a625bfa064f86bfa9cc)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-04-23 15:28:22 +02:00