3385 Commits

Author SHA1 Message Date
Boris Schrijver
5db3371840 Refactored NicProfile.java for readability.
See issue CLOUDSTACK-8736 for ongoing effort to clean up network code.
2015-08-17 14:12:10 +02:00
Remi Bergsma
0fcc7297e0 Merge pull request #680 from borisroman/CLOUDSTACK-8580
Interface changes related to CLOUDSTACK-8580See issue CLOUDSTACK-8580 and individual commits.

* pr/680:
  Made interface changes related to CLOUDSTACK-8580

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-14 11:47:36 +02:00
Boris Schrijver
655fcc924f Made interface changes related to CLOUDSTACK-8580
Added responses to ListCapabilities to reflect CLOUDSTACK-8580 changes.

This to add these options to the gui. See issue CLOUDSTACK-8580.

3be14e978a

Removed comments as proposed by Daan Hoogland.
2015-08-14 11:13:21 +02:00
John Burwell
ef44c7d305 CLOUDSTACK-8566: Strips the username and password credentials from host details
... map returned by the following API calls by filtering these fields from the
details attribute in the HostResponse class:

  * listHosts
  * addHost
  * cancelHostMaintenance
  * listHosts
  * prepareHostForMaintenance
  * reconnectHost
  * updateHost

This fix addresses CVE 2015-3251.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 3a48171bd8a70c6012afce32c7636afffc1d2f7d)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-14 10:49:40 +05:30
Boris Schrijver
03f48872d6 CLOUDSTACK-8133 Added Virtualmachine count and ID's to listSecurityGroups response.
See issue CLOUDSTACK-8133 for more information.

Added null check by comment of Koushik Das.

Added brackets by comment of Wido den Hollander.

Removed a call to findById() by comment of Koushik Das.

Signed-off-by: Wido den Hollander <wido@widodh.nl>
2015-08-13 13:47:38 +02:00
Mike Tutkowski
8b0266d12e Merge branch 'pr/547'
* pr/547:
  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.

Signed-off-by: Mike Tutkowski <mike.tutkowski@solidfire.com>
2015-08-10 19:00:53 -06:00
Anshul Gangwar
728635a3d3 CLOUDSTACK-8721: Fixed Setting details of VM through API results in removal of all other details except the one passed in API 2015-08-10 16:14:04 +05:30
Daan Hoogland
520e0c8de0 CLOUDSTACK-8656: code in comment removed 2015-07-30 15:52:17 +02:00
Sudhansu
fd17e47e15 BUG-ID: CLOUDSTACK-8483 - Private template not visible in project added new 'projectId' parameter in createTemplate command and based current user, account and projectid decide the owner of the template.
Signed-off-by: Pierre-Luc Dion <pdion891@apache.org>
2015-07-26 10:27:48 -04:00
Sudhansu
f8ef13c5e6 BUG-ID: CLOUDSTACK-8483 - Private template not visible in project added new 'projectId' parameter in createTemplate command and based current user, account and projectid decide the owner of the template.
Signed-off-by: Pierre-Luc Dion <pdion891@apache.org>
2015-07-26 10:27:48 -04:00
Boris Schrijver
2984acca83 CLOUDSTACK-8580 Users are now able to view, expunge and recover their vm's themselves. Two configuration options are added to allow this behaviour on a global or per account scale. Configuration options default to false.
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>

This closes #593
2015-07-23 13:59:44 +02:00
Wido den Hollander
8d96aab9b2 CLOUDSTACK-8581: Do not make attributes final and don't set them to null
Signed-off-by: Wido den Hollander <wido@widodh.nl>

This closes #582
2015-07-17 10:07:04 +02:00
Wido den Hollander
178a9f555d CLOUDSTACK-8581: S3, make connection TTL and TCP KeepAlive configureable
Signed-off-by: Wido den Hollander <wido@widodh.nl>
2015-07-17 10:07:04 +02:00
wilderrodrigues
984fafce77 CLOUDSTACK-8641 - Adding unit tests
- Making sure that the boolean value is false and also that the updateHostPassword() method gets called.

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

This closes #596
2015-07-16 18:28:27 +05:30
wilderrodrigues
c3c8baf259 CLOUDSTACK-8641 - When calling "update hostpassword" API it throws NPE if the update_passwd_on_host if not informed
- On getUpdatePasswdOnHost() method, if updatePasswdOnHost is null then return false.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-07-16 18:28:27 +05:30
Rohit Yadav
42940a8828 CLOUDSTACK-8622: Reinstate working sessions in browser
- Login is based on sessionkey HttpOnly Cookie
- ApiServlet does login verification using sessionKey from both the request cookies
  and the API parameters. In both cases, if either or both are passed they should
  match the sessionKey stored in the current session of the HttpRequest
- UI: it no longer needs to read or set sessionkey cookie
- UI: it no longer needs to return g_sessionKey value in the API requests, though
  to support a sso mechanism g_sessionKey is still passed in the API is not null
- Secure jsessionid cookie is set to be HttpOnly and Secure
- SAML login should also set HttpOnly cookie before redirecting to UI
- SAML: listIdps & getSPMetadata APIs are readonly now, won't log out a logged in user

Performed tests (login, saml login if applicable, page refreshes, opening
multiple tabs, logout) with following combinations:
- SAML disabled, normal auth as admin, domain-admin and user
- SAML enabled, normal auth as admin, domain-admin and user; and saml sso as
  admin, domain-admin and user

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

This closes #574
This closes #308
2015-07-10 17:25:07 +05:30
Jayapal
140cd7c227 CLOUDSTACK-8324: Fixed config key in multiple places 2015-07-10 09:47:09 +05:30
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
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
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