Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shiro #105

Merged
merged 245 commits into from
Sep 26, 2016
Merged

Shiro #105

merged 245 commits into from
Sep 26, 2016

Conversation

ganisimov
Copy link
Contributor

This PR is a naive implementation of role-based access control with Shiro.

Authentication

Currently, user may login by providing user name and password via POST request.
Credentials are validated against windows users and users populated in application database.

Authorization

Every API method checks before execution if user has a required permission. If user does not or isn't authenticated then UnauthorizedException is generated.

To provide flexibility, permission definitions consist of two parts. The first part describes a kind of action the method is supposed to perform, like 'read', 'update', etc. The second part is formed of relative URL path and may contain multiple levels.

For example, call to '/cohortdefinition/111/info' (where '111' is ID) is assigned to permission 'read:cohortdefinition:111:info'. So that to grant access to all methods which are marked with 'read' functionality, we just need to associate a role with permission 'read'. To grant access to all methods of 'cohortdefinition' service, we need to associate a role with permission '*:cohordefinition'. We can even restrict access only to certain IDs by giving permission like 'read:cohortdefinition:110,111:info'.

Here more on wildcard permissions in Shiro.
Here is an example of initial roles and permissions.

Further steps

  • Implement secure athentication. Currently, credentials are received from client via POST request.
  • Add API to manage users, roles and permissions.

chrisknoll and others added 30 commits July 14, 2015 16:33
Added new application.properties value:
flyway.placeholders.ohdsiSchema=${flyway.placeholders.ohdsiSchema}
spring.jpa.properties.hibernate.default_schema=${datasource.ohdsi.schema}

Manually applying JPA properties in DataAccessConfig.
initial progress on connecting the webapi to the RDF endpoint via sparql
This brings in the ability to make calls to the RDF endpoint to support the drill down use cases
- move getCohortSummaryData(), getCohortSummaryAnalyses() and
corresponding methods/mapper into CohortResultsService
- remove /sourceKey from path and modify service methods in
CohortAnalysisService
- add getOhdsiSchema() into AbstractDaoService
flyway postgresql and oracle migrations for concept sets
This merge brings in the getEvidenceSummaryBySource call
chrisknoll and others added 29 commits September 7, 2016 08:46
A BETWEEN X and Y becomes A >= X and A <= Y.  BETWEEN is not consistent between all db platforms.
Implementation of Incidence Rate web services, tasklets and repositories and IR Analysis Report Generation.

Added new dependency: apache commons collections v4.1.
Existing cohorts will have this null, so a null check is required.
Put new permissions for cohort created with 'copy' method.
	modified:   src/test/java/org/ohdsi/webapi/test/feasibility/StudyInfoTest.java
Conflicts:
	pom.xml
	src/main/java/org/ohdsi/webapi/service/CohortDefinitionService.java
	src/main/java/org/ohdsi/webapi/service/EvidenceService.java
	src/main/java/org/ohdsi/webapi/service/FeasibilityService.java
@fdefalco fdefalco merged commit 0f3297c into OHDSI:shiro Sep 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.