-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
bskjon
committed
May 20, 2024
1 parent
df70ba0
commit 0473079
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/main/kotlin/no/iktdev/streamit/library/db/tables/delegatedAuthenticationTable.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package no.iktdev.streamit.library.db.tables | ||
|
||
import no.iktdev.streamit.library.db.tables.catalog.defaultExpression | ||
import org.jetbrains.exposed.dao.id.IntIdTable | ||
import org.jetbrains.exposed.sql.Column | ||
import org.jetbrains.exposed.sql.javatime.CurrentDateTime | ||
import org.jetbrains.exposed.sql.javatime.datetime | ||
import java.time.Duration | ||
import java.time.LocalDateTime | ||
|
||
object delegatedAuthenticationTable: IntIdTable() { | ||
val pin: Column<Int> = integer("pin") | ||
val requesterId: Column<String> = char("requesterId", 64) | ||
val created: Column<LocalDateTime> = datetime("created").defaultExpression(CurrentDateTime) | ||
val expires: Column<LocalDateTime> = datetime("expires").clientDefault { LocalDateTime.now().plusMinutes(15) } | ||
|
||
init { | ||
uniqueIndex(requesterId) | ||
} | ||
} |