Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dwh-api
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AKTIN
dwh-api
Commits
b60b48e1
Commit
b60b48e1
authored
May 03, 2016
by
rwm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Authenticator and timestamps for query request
parent
f401805c
Pipeline
#1550
skipped
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
18 deletions
+43
-18
README.md
README.md
+1
-0
src/main/java/org/aktin/dwh/Authenticator.java
src/main/java/org/aktin/dwh/Authenticator.java
+12
-16
src/main/java/org/aktin/exchange/QueryRequest.java
src/main/java/org/aktin/exchange/QueryRequest.java
+9
-0
src/main/java/org/aktin/prefs/Preference.java
src/main/java/org/aktin/prefs/Preference.java
+19
-1
src/test/resources/request.xml
src/test/resources/request.xml
+2
-1
No files found.
README.md
View file @
b60b48e1
...
...
@@ -69,6 +69,7 @@ Query exchange
<!-- may also automatically reject requests:
reject all because of vacation,
reject specific recurring query -->
<reject-reason>La la la</reject-reason>
<comment></comment>
<last-execution>
<completed>XXXtimestamp</completed>
...
...
src/main/java/org/aktin/dwh/Authenticator.java
View file @
b60b48e1
package
org.aktin.dwh
;
import
java.security.Principal
;
public
interface
Authenticator
{
/**
* Determine whether the given user and password combination is granted
* the given role.
* @param user user name
* @param password password
* @param role role
* @return true if all criteria are matched, false otherwise
*/
boolean
verifyUserRole
(
String
user
,
char
[]
password
,
String
role
);
/**
* Determine whether a given user and password combination
*
has admin privileges.
Principal
authenticate
(
String
user
,
char
[]
password
);
boolean
isUserInRole
(
Principal
user
,
String
role
);
/** Determine whether a given user
has admin privileges.
*
* @param user user name
* @param password password
* @return true if the user is admin and the password is correct
* @param user user
* @return true if the user has administrative rights
*/
boolean
verifyAdmin
(
String
user
,
char
[]
password
);
boolean
isUserAdmin
(
Principal
user
);
}
src/main/java/org/aktin/exchange/QueryRequest.java
View file @
b60b48e1
...
...
@@ -34,10 +34,19 @@ public class QueryRequest {
/**
* Time stamp when the request was published at the query broker.
*/
@XmlElement
(
required
=
true
)
Instant
published
;
/**
* Time stamp for the earliest execution / when the request is open.
* If unspecified, the query can be executed at any time (usually
* before the deadline)
*/
@XmlElement
(
required
=
false
)
Instant
scheduled
;
/**
* Due date until which the query results have to be submitted.
*/
@XmlElement
(
required
=
true
)
Instant
deadline
;
/**
* Date when the request was closed by the query broker. While
...
...
src/main/java/org/aktin/prefs/Preference.java
View file @
b60b48e1
...
...
@@ -35,11 +35,29 @@ public interface Preference<T> {
* @param user user name
* @param value value
*/
public
void
setValue
(
String
user
,
T
value
);
public
void
setValue
(
T
value
,
String
user
);
/**
* Set the value by the system user
* @param value value
*/
public
void
setValue
(
T
value
);
/**
* Set the value to the given string representation. The value
* is changed by the system user.
* @param value string representing the value
* @throws IllegalArgumentException if the string conversion fails
*/
public
void
setValueString
(
String
value
)
throws
IllegalArgumentException
;
/**
* Set the value to the given string representation. The specified
* user name is used to perform the change.
*
* @param value string value
* @param user user name
* @throws IllegalArgumentException if string conversion fails
*/
public
void
setValueString
(
String
value
,
String
user
)
throws
IllegalArgumentException
;
}
src/test/resources/request.xml
View file @
b60b48e1
...
...
@@ -3,7 +3,8 @@
xmlns:xi=
"http://www.w3.org/2001/XInclude"
xmlns:xml=
"http://www.w3.org/XML/1998/namespace"
>
<id>
123
</id>
<published>
2016-04-28T00:00:00Z
</published>
<published>
2016-04-28T00:00:00Z
</published>
<scheduled>
2016-04-28T00:00:00Z
</scheduled>
<deadline>
2016-04-30T00:00:00Z
</deadline>
<xi:include
href=
"query.xml"
/>
...
...
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