Commit Graph

25463 Commits

Author SHA1 Message Date
Rohit Yadav c8cfb383da quota: for BigDecimal use String in API cmd and responses
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-07-14 14:54:54 +05:30
Rohit Yadav c4d82f0a60 quota: take value as string in add credit cmd
API was not working, using strign param we can create a BigDecimal value

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-07-14 14:23:55 +05:30
Rohit Yadav 473496b1d0 quota: use uniform response names
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-07-14 14:13:02 +05:30
Rohit Yadav fe422de985 client: fix label and usage
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-07-14 14:08:19 +05:30
Rohit Yadav 829bb17f7c quota: rename quotamapping to quotamappingcmd
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-07-14 14:07:56 +05:30
Rohit Yadav ccbe8decb3 quota: fix quota refresh API, reuse success response
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-07-14 13:53:12 +05:30
Rohit Yadav 9dc60bba61 quota: fix quotaRefresh API response keys
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-07-14 13:43:16 +05:30
Rohit Yadav 25cbdcc4f3 setup/db: fix schema issues, put quota stuff in cloud_usage db
Add missing column to cloud_usage

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-07-14 13:14:47 +05:30
Rohit Yadav 46931f92bc setup/db: fix schema issues, put quota stuff in cloud_usage db
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-07-14 13:02:47 +05:30
Abhinandan Prateek ae0eb6e334 CLOUDSTACK-8592: first cut implementation of quota statement 2015-07-14 12:18:25 +05:30
Abhinandan Prateek 7dd68a1493 CLOUDSTACK-8592: Schema updates 2015-07-14 12:13:05 +05:30
Rohit Yadav b08f228a28 setup/db: fix saml sql files, and create quota tables only if that don't exist
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-07-14 12:04:00 +05:30
Abhinandan Prateek df79834df9 CLOUDSTACK-8592: reverting debug statement 2015-07-14 11:35:52 +05:30
Abhinandan Prateek 135af2ceed CLOUDSTACK-8592: calculation of quota 2015-07-14 11:35:52 +05:30
Abhinandan Prateek 1b579afaeb CLOUDSTACK-8592: refactoring, cleanup 2015-07-14 11:35:52 +05:30
Abhinandan Prateek 53c22f6ba7 CLOUDSTACK-8592: adding QuotaEditResourceMappingCmd 2015-07-14 11:35:52 +05:30
Abhinandan Prateek b5e016288a CLOUDSTACK-8592: keep track of quota job runs - adding schema and daos 2015-07-14 11:35:52 +05:30
Abhinandan Prateek a558afae57 CLOUDSTACK-8592: Adding new APIs and implementing the API stubs 2015-07-14 11:35:52 +05:30
Rohit Yadav f6e7c52c12 ui/scripts/cloudStack: simplify plugin loop and display check
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-07-14 11:35:52 +05:30
Rohit Yadav 0b64910e09 ui/plugins: Add initial Quota plugin
- Adds a stub
- Adds a Quota tab on the user's page

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-07-14 11:35:52 +05:30
Rohit Yadav dec8928749 ui: Allow plugins to be shown on navigation bar, if they want to
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-07-14 11:35:52 +05:30
Abhinandan Prateek 65618bbac2 CLOUDSTACK-8592: adding corresponding DAOs with stubs 2015-07-14 11:35:52 +05:30
Abhinandan Prateek d160da07cf CLOUDSTACK-8592: adding corresponding DAOs with stubs 2015-07-14 11:35:52 +05:30
Abhinandan Prateek 6c4dea7bb8 CLOUDSTACK-8592: creating respective VO objects 2015-07-14 11:35:52 +05:30
Abhinandan Prateek 2c37ddb48b CLOUDSTACK-8592: adding quota usaage and balance tables 2015-07-14 11:35:52 +05:30
Abhinandan Prateek dbee0a9a2d adding pom dependencies for usage 2015-07-14 11:35:52 +05:30
Abhinandan Prateek 3103dcf7bc CLOUDSTACK-8592: updated quota email templates 2015-07-14 11:35:52 +05:30
Abhinandan Prateek 1345b9fbfb CLOUDSTACK-8592: Adding email management APIs 2015-07-14 11:35:51 +05:30
Rohit Yadav 1f75299016 quota: fix db bean issue
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-07-14 11:35:51 +05:30
Rohit Yadav bf57cb6580 apidoc: add section for quota APIs
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-07-14 11:35:51 +05:30
Rohit Yadav 389b041994 schema-451to452: Re-add SAML SQL changes reverted in 5ea1a89
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-07-14 11:35:51 +05:30
Abhinandan Prateek 56707ad01f CLOUDSTACK-8592: add quota email template management commands 2015-07-14 11:35:51 +05:30
Abhinandan Prateek 46be58d602 raised the version to 4.5.2 in pom 2015-07-14 11:35:51 +05:30
Abhinandan Prateek c9770e7777 merging fixes 2015-07-14 11:35:51 +05:30
Abhinandan Prateek 1da4271b17 adding quota credit api 2015-07-14 11:35:51 +05:30
Abhinandan Prateek 38f26e9b9b updating sql scripts 2015-07-14 11:35:51 +05:30
Abhinandan Prateek aee049297a adding quota API to commands.properties 2015-07-14 11:35:51 +05:30
Abhinandan Prateek 605239df72 quota: initial commit 2015-07-14 11:35:51 +05:30
Rohit Yadav d2e5bc6649 CLOUDSTACK-8457: SAML UI Dialog fixes to use local $form
This uses local selector to access the DOM elements, the previous commit
would find a global element which is not in the context and fail changing the
element in the opened dialog.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-07-14 11:31:27 +05:30
Rohit Yadav 3938b43c4d CLOUDSTACK-8457: SAML UI enhancements
Add option to authorize SAML SSO for user when adding user. Appends a domain to
user/account name if global setting is enabled, useful in case of multiple IDP
server. By default the setting is set to false (keep as it is).

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

This closes #575

(cherry picked from commit 7d11c7bc70)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-07-14 10:23:11 +05:30
Rohit Yadav 5f51a6431d 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

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

Conflicts:
	server/src/com/cloud/api/ApiServlet.java
	utils/src/com/cloud/utils/HttpUtils.java
2015-07-14 10:22:40 +05:30
Rohit Yadav 8bb0a70a56 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

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

This closes #489

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-06-29 13:49:39 +02:00
Rohit Yadav 76868f5767 cloudstack: Change version to 4.5.2
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-06-29 13:43:49 +02:00
Daan Hoogland e1f650f4f7 4.4.4 to 4.5.2 upgrade
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #528
2015-06-29 13:38:04 +02:00
Rohit Yadav 7520c60378 engine: add upgrade path from 4.5.1 to 4.5.2
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-06-29 13:36:22 +02:00
Rohit Yadav 11a6073ada schema: fix foreign key checks for 3.0.7 to 4.1.0 upgrade path
Without this upgrades from 3.0.7 version fails.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-06-29 13:36:22 +02:00
Abhinandan Prateek 95b46de562 Adding upgrade path to go with current 4.5.2 version for this branch 2015-06-29 13:36:22 +02:00
Rohit Yadav 8b18ab3ff2 Fix version to 4.5.2-SNAPSHOT throughout the source
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-05-08 11:35:59 +02:00
Rohit Yadav 0963432268 apidoc: get version information from $project.version
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-05-08 11:35:34 +02:00
Rohit Yadav d0d08e68e9 tools: fix build
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-05-08 11:11:10 +02:00