-
Notifications
You must be signed in to change notification settings - Fork 0
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
[ID-1117] Add fence_account_key and distributed_lock tables to db #174
Changes from 3 commits
73fd8a2
6c996e9
5b99a70
0f250c9
09c2d11
da62d3b
2668876
97c8c89
c39836f
f0a6de3
ccfc78f
fcdd682
dded2a2
b81b81d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package bio.terra.externalcreds.models; | ||
|
||
import java.sql.Timestamp; | ||
import org.immutables.value.Value; | ||
|
||
@Value.Immutable | ||
public interface DistributedLock extends WithDistributedLock { | ||
String getLockName(); | ||
|
||
String getUserId(); | ||
|
||
Timestamp getExpiresAt(); | ||
|
||
class Builder extends ImmutableDistributedLock.Builder {} | ||
} | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package bio.terra.externalcreds.models; | ||
|
||
import java.sql.Timestamp; | ||
import java.util.Optional; | ||
import org.immutables.value.Value; | ||
|
||
@Value.Immutable | ||
public interface FenceAccountKey extends WithFenceAccountKey { | ||
Integer getId(); | ||
|
||
Optional<String> getKeyJson(); | ||
|
||
Timestamp getExpiresAt(); | ||
|
||
class Builder extends ImmutableFenceAccountKey.Builder {} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
databaseChangeLog: | ||
- changeSet: | ||
id: "add_fence_account_key_and_dist_lock_table" | ||
author: sehsan | ||
changes: | ||
- createTable: | ||
tableName: fence_account_key | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we also need a foreign key to the user's There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That does make sense! |
||
columns: | ||
- column: | ||
name: id | ||
type: int | ||
autoIncrement: true | ||
constraints: | ||
primaryKey: true | ||
nullable: false | ||
- column: | ||
name: key_json | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: maybe this should be called key_json_base64? |
||
type: text | ||
constraints: | ||
nullable: false | ||
- column: | ||
name: expires_at | ||
type: timestamp | ||
constraints: | ||
nullable: false | ||
- createTable: | ||
tableName: distributed_lock | ||
columns: | ||
- column: | ||
name: lock_name | ||
type: text | ||
constraints: | ||
primaryKey: true | ||
primaryKeyName: pk_dist_lock | ||
- column: | ||
name: user_id | ||
type: text | ||
constraints: | ||
primaryKey: true | ||
primaryKeyName: pk_dist_lock | ||
- column: | ||
name: expires_at | ||
type: timestamp | ||
constraints: | ||
nullable: false |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,6 @@ databaseChangeLog: | |
- include: | ||
file: changesets/20220412_add_last_encrypt_timestamp_to_ssh_key_pair_table.yaml | ||
relativeToChangelogFile: true | ||
- include: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a merge conflict here. Make sure this changeset comes after the just-merged changeset. |
||
file: changesets/20240228_add_fence_account_key_and_dist_lock_table.yaml | ||
relativeToChangelogFile: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably use
java.time.Instant
here instead of the SQL Timestamp.