Skip to content

Commit

Permalink
Merge pull request #612 from wultra/develop
Browse files Browse the repository at this point in the history
Merge changes into master
  • Loading branch information
romanstrobl authored Jun 8, 2021
2 parents 7a7ba9d + 2d15b56 commit 9c190c4
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 3 deletions.
7 changes: 5 additions & 2 deletions docs/Database-Structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,9 @@ CREATE TABLE "pa_application_callback"
"id" VARCHAR(37) NOT NULL PRIMARY KEY,
"application_id" INTEGER NOT NULL,
"name" VARCHAR(255),
"callback_url" VARCHAR(1024),
"attributes" VARCHAR(1024)
"callback_url" TEXT NOT NULL,
"type" VARCHAR(64) DEFAULT 'ACTIVATION_STATUS_CHANGE' NOT NULL,
"attributes" TEXT NOT NULL
);
```

Expand All @@ -294,6 +295,8 @@ CREATE TABLE "pa_application_callback"
| application_id | BIGINT(20) | foreign key: pa\_application.id | Associated application ID. |
| name | VARCHAR(255) | - | Callback name, anything that visually identifies the callback purpose. |
| callback_url | TEXT | - | Callback URL value, any URL that can receive activation update callback. |
| type | VARCHAR(64) | - | Callback type: `ACTIVATION_STATUS_CHANGE` or `OPERATION_STATUS_CHANGE`. |
| attributes | TEXT | - | Callback attributes as a key-value map, serialized into JSON. |
<!-- end -->

<!-- begin database table pa_token -->
Expand Down
2 changes: 1 addition & 1 deletion docs/PowerAuth-Server-1.1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ ALTER TABLE pa_application_callback

```sql
ALTER TABLE pa_application_callback
ADD type VARCHAR2(64) DEFAULT 'ACTIVATION_STATUS_CHANGE' NOT NULL;
ADD type VARCHAR2(64 CHAR) DEFAULT 'ACTIVATION_STATUS_CHANGE' NOT NULL;
```

The `CreateCallbackUrlRequest` also now contains a new mandatory attribute `type` that can be either `ACTIVATION_STATUS_CHANGE` or `OPERATION_STATUS_CHANGE`.
Expand Down
1 change: 1 addition & 0 deletions docs/sql/mysql/create_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ CREATE TABLE `pa_application_callback` (
`application_id` bigint(20) NOT NULL,
`name` varchar(255) DEFAULT NULL,
`callback_url` text NOT NULL,
`type` VARCHAR(64) DEFAULT 'ACTIVATION_STATUS_CHANGE' NOT NULL,
`attributes` text NOT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `FK_APPLICATION_CALLBACK` FOREIGN KEY (`application_id`) REFERENCES `pa_application` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
Expand Down
1 change: 1 addition & 0 deletions docs/sql/oracle/create_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ CREATE TABLE "PA_APPLICATION_CALLBACK"
"APPLICATION_ID" NUMBER(19,0) NOT NULL,
"NAME" VARCHAR2(255 CHAR),
"CALLBACK_URL" VARCHAR2(1024 CHAR),
"TYPE" VARCHAR2(64 CHAR) DEFAULT 'ACTIVATION_STATUS_CHANGE' NOT NULL,
"ATTRIBUTES" VARCHAR2(1024 CHAR)
);

Expand Down
1 change: 1 addition & 0 deletions docs/sql/postgresql/create_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ CREATE TABLE "pa_application_callback"
"application_id" INTEGER NOT NULL,
"name" VARCHAR(255),
"callback_url" VARCHAR(1024),
"type" VARCHAR(64) DEFAULT 'ACTIVATION_STATUS_CHANGE' NOT NULL,
"attributes" VARCHAR(1024)
);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
/*
* PowerAuth Server and related software components
* Copyright (C) 2021 Wultra s.r.o.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package io.getlime.security.powerauth.app.server.database.model.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
* Entity representing the Shedlock items. The entity is not used directly via JPA repositories.
* We have it here so that databases that create schema based on entities have easier task in
* picking the entire schema. This is particularly helpful while running tests with in-memory
* databases.
*
* @author Petr Dvorak, [email protected]
*/
@Entity
@Table(name = "shedlock")
public class ShedlockEntity implements Serializable {

private static final long serialVersionUID = 3791580797958213663L;

@Id
@Column(name = "name", nullable = false)
private String name;

@Column(name = "lock_until", nullable = false)
private Date lockUntil;

@Column(name = "locked_at", nullable = false)
private Date lockedAt;

@Column(name = "locked_by", nullable = false)
private String lockedBy;

/**
* Get name.
* @return Name.
*/
public String getName() {
return name;
}

/**
* Set name.
* @param name Name.
*/
public void setName(String name) {
this.name = name;
}

/**
* Get lock until.
* @return Lock until.
*/
public Date getLockUntil() {
return lockUntil;
}

/**
* Set lock until.
* @param lockUntil Lock until.
*/
public void setLockUntil(Date lockUntil) {
this.lockUntil = lockUntil;
}

/**
* Get locked at.
* @return Locked at.
*/
public Date getLockedAt() {
return lockedAt;
}

/**
* Set locked at.
* @param lockedAt Locked at.
*/
public void setLockedAt(Date lockedAt) {
this.lockedAt = lockedAt;
}

/**
* Get locked by.
* @return Locked by.
*/
public String getLockedBy() {
return lockedBy;
}

/**
* Set locked by.
* @param lockedBy Locked by.
*/
public void setLockedBy(String lockedBy) {
this.lockedBy = lockedBy;
}
}

0 comments on commit 9c190c4

Please sign in to comment.