33 Commits

Author SHA1 Message Date
Will Stevens
20cf8b23c0 Merge pull request #1453 from GabrielBrascher/brascher-removeUnusedClasses2
Remove classes with no referencesI used UCDetector (http://www.ucdetector.org/) as a plugin for Eclipse.  With this tool, I discovered a lot of code without any reference (variables, methods and classes).

Following the work that was done at [https://github.com/apache/cloudstack/pull/1448]; this pull request had the goal of removing some of these classes. To check if I wasn't missing anything I searched for any file that could reference some of those classes. As I haven't found any way of these classes being used, they were removed. Note that some of them I found other references, but references such as commented lines or tests, nothing that could indicate their use (as XML files configuring beans or another class instantiating an object with "new").

Waiting for tests. Please tell me if I am missing something.

Removed Classes:
- org.apache.cloudstack.framework.jobs.JobCancellationException (**Note:** removed
variable JobCancellationException in com.cloud.utils.SerialVersionUID)
- org.apache.cloudstack.ldap.NoSuchLdapUserException (**Note:** removed test file
/cloud-plugin-user-authenticator-ldap/test/groovy/org/apache/cloudstack/ldap/NoSuchLdapUserExceptionSpec.groovy)
- com.cloud.agent.api.storage.CreateVolumeOVAAnswer
- com.cloud.exception.MissingParameterValueException
- org.apache.cloudstack.api.response.StatusResponse
- org.apache.cloudstack.api.response.VolumeDetailResponse
- org.apache.cloudstack.api.response.UpgradeVmResponse
- org.apache.cloudstack.api.response.AddIpToVmNicResponse
- org.apache.cloudstack.api.response.TemplateZoneResponse (**Note:** at
org.apache.cloudstack.api.response.TemplateResponse, there is this
comment "To avoid breaking backwards compatibility, we still treat a
template at different zones as different templates, so not embedding
template_zone information in this TemplateZoneResponse set. `private
Set<TemplateZoneResponse> zones;`" but right now it is not used)
- org.apache.cloudstack.api.response.NicDetailResponse

* pr/1453:
  Removed classes with no reference

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-12 16:48:03 -04:00
Rohit Yadav
4347776ac6 CLOUDSTACK-8562: DB-Backed Dynamic Role Based API Access Checker
This feature allows root administrators to define new roles and associate API
permissions to them.

A limited form of role-based access control for the CloudStack management server
API is provided through a properties file, commands.properties, embedded in the
WAR distribution. Therefore, customizing API permissions requires unpacking the
distribution and modifying this file consistently on all servers. The old system
also does not permit the specification of additional roles.

FS:
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Dynamic+Role+Based+API+Access+Checker+for+CloudStack

DB-Backed Dynamic Role Based API Access Checker for CloudStack brings following
changes, features and use-cases:
- Moves the API access definitions from commands.properties to the mgmt server DB
- Allows defining custom roles (such as a read-only ROOT admin) beyond the
  current set of four (4) roles
- All roles will resolve to one of the four known roles types (Admin, Resource
  Admin, Domain Admin and User) which maintains this association by requiring
  all new defined roles to specify a role type.
- Allows changes to roles and API permissions per role at runtime including additions or
  removal of roles and/or modifications of permissions, without the need
  of restarting management server(s)

Upgrade/installation notes:
- The feature will be enabled by default for new installations, existing
  deployments will continue to use the older static role based api access checker
  with an option to enable this feature
- During fresh installation or upgrade, the upgrade paths will add four default
  roles based on the four default role types
- For ease of migration, at the time of upgrade commands.properties will be used
  to add existing set of permissions to the default roles. cloud.account
  will have a new role_id column which will be populated based on default roles
  as well

Dynamic-roles migration tool: scripts/util/migrate-dynamicroles.py
- Allows admins to migrate to the dynamic role based checker at a future date
- Performs a harder one-way migrate and update
- Migrates rules from existing commands.properties file into db and deprecates it
- Enables an internal hidden switch to enable dynamic role based checker feature

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-05-11 09:45:19 +05:30
weingartner
4179606c0b Removed classes with no reference
- org.apache.cloudstack.framework.jobs.JobCancellationException (removed
variable JobCancellationException in com.cloud.utils.SerialVersionUID)
- org.apache.cloudstack.ldap.NoSuchLdapUserException (removed test file
/cloud-plugin-user-authenticator-ldap/test/groovy/org/apache/cloudstack/ldap/NoSuchLdapUserExceptionSpec.groovy)
- com.cloud.agent.api.storage.CreateVolumeOVAAnswer
- com.cloud.exception.MissingParameterValueException
- org.apache.cloudstack.api.response.StatusResponse
- org.apache.cloudstack.api.response.VolumeDetailResponse
- org.apache.cloudstack.api.response.UpgradeVmResponse
- org.apache.cloudstack.api.response.AddIpToVmNicResponse
- org.apache.cloudstack.api.response.TemplateZoneResponse (at
org.apache.cloudstack.api.response.TemplateResponse, there is this
comment "To avoid breaking backwards compatibility, we still treat a
template at different zones as different templates, so not embedding
template_zone information in this TemplateZoneResponse set. `private
Set<TemplateZoneResponse> zones;`" but right now it is not used)
- org.apache.cloudstack.api.response.NicDetailResponse
2016-04-07 21:03:05 -03:00
Rajani Karuturi
53a441faf6 CLOUDSTACK-8647: linkdomaintoldap shouldnt fail when createuseraccount fails
Incase create useraccount fails with any runtime exception,
linkdomaintoldap api shouldnt fail. It just will not return the admin id
as it didnt create the account.
added test cases to verify this as well.
2015-09-03 18:05:50 +05:30
Rajani Karuturi
ca8b37535a CLOUDSTACK-8647: updated with review comments
made domainId compulsory in api LinkDomainToLdapCmd
used accountServive from BaseCmd in LinkDomainToLdapCmd
changed the allowed account type values to 0 and 2
2015-09-01 10:44:30 +05:30
Rajani Karuturi
1c836a8999 CLOUDSTACK-8647: unittests for LdapAuthenticatorSpec 2015-08-27 17:34:02 +05:30
Rajani Karuturi
c2b36cb705 CLOUDSTACK-8647: formatted LdapAuthenticatorSpec 2015-08-27 17:34:02 +05:30
Rajani Karuturi
6572abc7b3 CLOUDSTACK-8647 added unittests for new methods in ldapmanager 2015-08-27 17:30:23 +05:30
Rajani Karuturi
dd6d6d18a5 CLOUDSTACK-8647 unittests for LinkDomainToLdap api command 2015-08-27 17:30:23 +05:30
Rajani Karuturi
6cb5d3a3bc CLOUDSTACK-8647: fixed unittests 2015-08-27 17:30:22 +05:30
radu-stefanache
c7a3ad4dc0 More typos 2015-08-20 13:04:29 +01:00
Rajani Karuturi
96cf0325e2 CLOUDSTACK-8596 addressed review comments
In LdapUserManagerFactory moved the beans to a map
used a Enum for LdapProvider and made the corresponding changes in
LdapConfiguration and the callers.
2015-07-23 15:21:59 +05:30
Rajani Karuturi
4e57cc62d0 CLOUDSTACK-8596 ability to query nested groups for Microsoft AD
added a new configuration to select the appropriate ldap implementation
incase of microsoft AD enabled nested querying of group members

moved LdapUserManager to an interface and added separate implementations
for openLdap and microsoft AD
Added unit tests
2015-07-20 18:00:57 +05:30
Rajani Karuturi
d46b658ec0 Fixed CLOUDSTACK-8551 Findbugs warning in LdapCreateAccountCmd.java
byte[].toString() would give reference to the array (ex: [B@6c521576 )
but not the original string.  used new String() to get the text.
2015-06-11 14:05:03 +05:30
Rajani Karuturi
843f6b1691 CLOUDSTACK-5236 : ability to identify where the user is from (ex. LDAP)
Added a source column to the user table.

Source now has only two values UNKNOWN,LDAP with UNKNOWN being the
default and is an enum is com.cloud.User.

When the source is UNKNOWN, the old method of authenticating against all
the available authenticators is used. If a source is available, only
that particular authenticator will be used.

added overloaded methods in AccountService to createUserAccount and
createUser with source specified.

(cherry picked from commit 5da733072e838c830720909ef5ba27ef6ce6d0b0)
2015-03-16 14:53:53 +05:30
Rajani Karuturi
14f3ad55ec Fixed CLOUDSTACK-7374: added PaginationControl while querying ldap users 2014-08-20 15:58:08 +05:30
Rajani Karuturi
736ff5f8e5 Fixed CLOUDSTACK-7303 [LDAP] while importing ldap users, update the user info if it already exists in cloudstack 2014-08-11 17:54:31 +05:30
Rajani Karuturi
fca41bf527 Fixed bug: CLOUDSTACK-7214 added a config for ldap connection read timeout. 2014-08-01 16:32:45 +05:30
Rajani Karuturi
f7c664fc2e Revert "Fixed bug: CLOUDSTACK-7214 added a config for ldap connection read timeout."
This reverts commit cd2f27a6628472b1c0a6289989dc802f534ec74e.

reverting it as it breaks the build when encryption is enabled.
2014-08-01 11:20:20 +05:30
Rajani Karuturi
cd2f27a662 Fixed bug: CLOUDSTACK-7214 added a config for ldap connection read timeout. 2014-07-31 17:33:18 +05:30
Rajani Karuturi
5fa2d1c7ca Fixed Bug: CLOUDSTACK-7200 [LDAP] importUsersCmd for a group fails incase any member of a group is not an user 2014-07-30 12:02:24 +05:30
Rajani Karuturi
f4779b4d0c Fixed CLOUDSTACK-6509 Cannot import multiple LDAP/AD users into a cloudstack account
Conflicts:
	api/src/com/cloud/user/AccountService.java
	plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapCreateAccountCmd.java
	plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapImportUsersCmd.java

Signed-off-by: Koushik Das <koushik@apache.org>
2014-04-29 14:49:06 +05:30
Rajani Karuturi
4552ec6322 Fixed CLOUDSTACK-6210 LDAP:listLdapUsers api throws exception when we click on "Add LDAP Account" This occurs when ldap basedn is not configured. Throwing an IAE and a proper message is returned from the api call
Signed-off-by: Ian Duffy <ian@ianduffy.ie>
2014-03-07 16:57:13 +00:00
Rajani Karuturi
917ea33ba9 added LDAP group name label in add account wizard
changed the parameter for domain in api importLdapUser from name to UUID

improved error handling
2013-11-20 13:57:41 +01:00
Rajani Karuturi
b436a82392 added group and domain params to importLdapUsers api call
Signed-off-by: Ian Duffy <ian@ianduffy.ie>
2013-10-31 22:06:32 +00:00
Rajani Karuturi
9300d4a3ba Added an api call to import all the ldap users to the same domains(ou's) in cloudstack
TODO:
    1. error handling of no domains present, nested hierarchy
    2. handling the case when the api call fails for a specific user/users
    3. test cases for LdapUserManager

Signed-off-by: Ian Duffy <ian@ianduffy.ie>
2013-10-29 09:04:33 +00:00
Daan Hoogland
2fb6ae814f copyright 2013-09-01 23:59:53 +02:00
Ian Duffy
bdba0ddeed Bring up to date with master 2013-08-31 00:25:48 +01:00
Ian Duffy
7f7035d516 Update unit tests, add filter to list all users, update ssl
Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
2013-08-12 14:49:55 +05:30
Ian Duffy
25e8e9b85f General cleanup, source formatting, remove whitespace
Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
2013-08-02 14:20:47 +05:30
Ian Duffy
532e04db1a Disable password changing when ldap is enabled
Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
2013-08-02 14:20:47 +05:30
Ian Duffy
ec064b3077 New LDAP UI
Signed-off-by: Sebastien Goasguen <runseb@gmail.com>
2013-07-29 05:58:00 -04:00
Ian Duffy
eaa4143371 Merge LDAPPlugin
Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
2013-07-25 17:54:52 +05:30