Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CONF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UvA
CONF
Commits
fb964b1c
Commit
fb964b1c
authored
Mar 14, 2017
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added delete all
parent
f8bf53aa
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
33 additions
and
9 deletions
+33
-9
resource_CloudCredentialsController.html
...-api/doc/apidocs/resource_CloudCredentialsController.html
+2
-2
CloudCredentialsService.java
.../nl/uva/sne/drip/api/service/CloudCredentialsService.java
+7
-0
DeployClusterService.java
...ava/nl/uva/sne/drip/api/service/DeployClusterService.java
+11
-4
PlannerService.java
...main/java/nl/uva/sne/drip/api/service/PlannerService.java
+6
-1
UserScriptService.java
...n/java/nl/uva/sne/drip/api/service/UserScriptService.java
+7
-0
UserController.java
...main/java/nl/uva/sne/drip/api/v1/rest/UserController.java
+0
-1
UserScriptController.java
...ava/nl/uva/sne/drip/api/v1/rest/UserScriptController.java
+0
-1
docker_swarm.pyc
drip-deployer/docker_swarm.pyc
+0
-0
No files found.
drip-api/doc/apidocs/resource_CloudCredentialsController.html
View file @
fb964b1c
...
@@ -174,7 +174,7 @@ Accept: application/json
...
@@ -174,7 +174,7 @@ Accept: application/json
}, {
}, {
"
name
"
:
"
...
"
,
"
name
"
:
"
...
"
,
"
id
"
:
"
...
"
,
"
id
"
:
"
...
"
,
"
type
"
:
"
P
RIVATE
"
,
"
type
"
:
"
P
UBLIC
"
,
"
attributes
"
: {
"
attributes
"
: {
"
property1
"
:
"
...
"
,
"
property1
"
:
"
...
"
,
"
property2
"
:
"
...
"
"
property2
"
:
"
...
"
...
@@ -429,7 +429,7 @@ Content-Type: application/json
...
@@ -429,7 +429,7 @@ Content-Type: application/json
}, {
}, {
"
name
"
:
"
...
"
,
"
name
"
:
"
...
"
,
"
id
"
:
"
...
"
,
"
id
"
:
"
...
"
,
"
type
"
:
"
P
UBLIC
"
,
"
type
"
:
"
P
RIVATE
"
,
"
attributes
"
: {
"
attributes
"
: {
"
property1
"
:
"
...
"
,
"
property1
"
:
"
...
"
,
"
property2
"
:
"
...
"
"
property2
"
:
"
...
"
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/service/CloudCredentialsService.java
View file @
fb964b1c
...
@@ -17,6 +17,7 @@ package nl.uva.sne.drip.api.service;
...
@@ -17,6 +17,7 @@ package nl.uva.sne.drip.api.service;
import
java.util.List
;
import
java.util.List
;
import
nl.uva.sne.drip.api.dao.CloudCredentialsDao
;
import
nl.uva.sne.drip.api.dao.CloudCredentialsDao
;
import
nl.uva.sne.drip.api.exception.NotFoundException
;
import
nl.uva.sne.drip.commons.v1.types.CloudCredentials
;
import
nl.uva.sne.drip.commons.v1.types.CloudCredentials
;
import
nl.uva.sne.drip.commons.v1.types.User
;
import
nl.uva.sne.drip.commons.v1.types.User
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -47,12 +48,18 @@ public class CloudCredentialsService {
...
@@ -47,12 +48,18 @@ public class CloudCredentialsService {
@PostAuthorize
(
"(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))"
)
@PostAuthorize
(
"(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))"
)
public
CloudCredentials
findOne
(
String
id
)
{
public
CloudCredentials
findOne
(
String
id
)
{
CloudCredentials
creds
=
dao
.
findOne
(
id
);
CloudCredentials
creds
=
dao
.
findOne
(
id
);
if
(
creds
==
null
)
{
throw
new
NotFoundException
();
}
return
creds
;
return
creds
;
}
}
@PostAuthorize
(
"(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))"
)
@PostAuthorize
(
"(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))"
)
public
CloudCredentials
delete
(
String
id
)
{
public
CloudCredentials
delete
(
String
id
)
{
CloudCredentials
creds
=
dao
.
findOne
(
id
);
CloudCredentials
creds
=
dao
.
findOne
(
id
);
if
(
creds
==
null
)
{
throw
new
NotFoundException
();
}
dao
.
delete
(
creds
);
dao
.
delete
(
creds
);
return
creds
;
return
creds
;
}
}
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/service/DeployClusterService.java
View file @
fb964b1c
...
@@ -69,7 +69,11 @@ public class DeployClusterService {
...
@@ -69,7 +69,11 @@ public class DeployClusterService {
@PostAuthorize
(
"(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))"
)
@PostAuthorize
(
"(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))"
)
public
ClusterCredentials
findOne
(
String
id
)
{
public
ClusterCredentials
findOne
(
String
id
)
{
return
dao
.
findOne
(
id
);
ClusterCredentials
creds
=
dao
.
findOne
(
id
);
if
(
creds
==
null
)
{
throw
new
NotFoundException
();
}
return
creds
;
}
}
@PostFilter
(
"(filterObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))"
)
@PostFilter
(
"(filterObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))"
)
...
@@ -79,9 +83,12 @@ public class DeployClusterService {
...
@@ -79,9 +83,12 @@ public class DeployClusterService {
@PostAuthorize
(
"(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))"
)
@PostAuthorize
(
"(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))"
)
public
ClusterCredentials
delete
(
String
id
)
{
public
ClusterCredentials
delete
(
String
id
)
{
ClusterCredentials
cred
=
dao
.
findOne
(
id
);
ClusterCredentials
creds
=
dao
.
findOne
(
id
);
dao
.
delete
(
cred
);
if
(
creds
==
null
)
{
return
cred
;
throw
new
NotFoundException
();
}
dao
.
delete
(
creds
);
return
creds
;
}
}
public
ClusterCredentials
save
(
ClusterCredentials
clusterCred
)
{
public
ClusterCredentials
save
(
ClusterCredentials
clusterCred
)
{
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/service/PlannerService.java
View file @
fb964b1c
...
@@ -187,7 +187,12 @@ public class PlannerService {
...
@@ -187,7 +187,12 @@ public class PlannerService {
@PostAuthorize
(
"(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))"
)
@PostAuthorize
(
"(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))"
)
public
Plan
findOne
(
String
lowiID
)
{
public
Plan
findOne
(
String
lowiID
)
{
return
planDao
.
findOne
(
lowiID
);
Plan
plan
=
planDao
.
findOne
(
lowiID
);
if
(
plan
==
null
)
{
throw
new
NotFoundException
();
}
return
plan
;
}
}
@PostAuthorize
(
"(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))"
)
@PostAuthorize
(
"(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))"
)
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/service/UserScriptService.java
View file @
fb964b1c
...
@@ -20,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -20,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
nl.uva.sne.drip.api.dao.ScriptDao
;
import
nl.uva.sne.drip.api.dao.ScriptDao
;
import
nl.uva.sne.drip.api.exception.NotFoundException
;
import
nl.uva.sne.drip.commons.v1.types.Script
;
import
nl.uva.sne.drip.commons.v1.types.Script
;
import
nl.uva.sne.drip.commons.v1.types.User
;
import
nl.uva.sne.drip.commons.v1.types.User
;
import
org.springframework.security.access.prepost.PostAuthorize
;
import
org.springframework.security.access.prepost.PostAuthorize
;
...
@@ -47,12 +48,18 @@ public class UserScriptService {
...
@@ -47,12 +48,18 @@ public class UserScriptService {
@PostAuthorize
(
"(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))"
)
@PostAuthorize
(
"(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))"
)
public
Script
findOne
(
String
id
)
{
public
Script
findOne
(
String
id
)
{
Script
script
=
dao
.
findOne
(
id
);
Script
script
=
dao
.
findOne
(
id
);
if
(
script
==
null
)
{
throw
new
NotFoundException
();
}
return
script
;
return
script
;
}
}
@PostAuthorize
(
"(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))"
)
@PostAuthorize
(
"(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))"
)
public
Script
delete
(
String
id
)
{
public
Script
delete
(
String
id
)
{
Script
script
=
dao
.
findOne
(
id
);
Script
script
=
dao
.
findOne
(
id
);
if
(
script
==
null
)
{
throw
new
NotFoundException
();
}
dao
.
delete
(
script
);
dao
.
delete
(
script
);
return
script
;
return
script
;
}
}
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/v1/rest/UserController.java
View file @
fb964b1c
...
@@ -33,7 +33,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
...
@@ -33,7 +33,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
nl.uva.sne.drip.api.service.UserService
;
import
nl.uva.sne.drip.api.service.UserService
;
import
org.springframework.security.access.prepost.PostAuthorize
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/v1/rest/UserScriptController.java
View file @
fb964b1c
...
@@ -31,7 +31,6 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -31,7 +31,6 @@ import org.springframework.web.multipart.MultipartFile;
import
nl.uva.sne.drip.api.exception.NotFoundException
;
import
nl.uva.sne.drip.api.exception.NotFoundException
;
import
nl.uva.sne.drip.commons.v1.types.Script
;
import
nl.uva.sne.drip.commons.v1.types.Script
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
nl.uva.sne.drip.api.dao.ScriptDao
;
import
nl.uva.sne.drip.api.service.UserScriptService
;
import
nl.uva.sne.drip.api.service.UserScriptService
;
/**
/**
...
...
drip-deployer/docker_swarm.pyc
View file @
fb964b1c
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment