2025-03-11 14:16:42 -05:00
|
|
|
package dto
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
datatype "github.com/pocket-id/pocket-id/backend/internal/model/types"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type ApiKeyCreateDto struct {
|
2025-07-13 18:15:57 +02:00
|
|
|
Name string `json:"name" binding:"required,min=3,max=50" unorm:"nfc"`
|
2025-08-10 10:56:03 -05:00
|
|
|
Description *string `json:"description" unorm:"nfc"`
|
2025-03-11 14:16:42 -05:00
|
|
|
ExpiresAt datatype.DateTime `json:"expiresAt" binding:"required"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ApiKeyDto struct {
|
2025-04-20 09:40:20 -05:00
|
|
|
ID string `json:"id"`
|
|
|
|
|
Name string `json:"name"`
|
2025-08-10 10:56:03 -05:00
|
|
|
Description *string `json:"description"`
|
2025-04-20 09:40:20 -05:00
|
|
|
ExpiresAt datatype.DateTime `json:"expiresAt"`
|
|
|
|
|
LastUsedAt *datatype.DateTime `json:"lastUsedAt"`
|
|
|
|
|
CreatedAt datatype.DateTime `json:"createdAt"`
|
|
|
|
|
ExpirationEmailSent bool `json:"expirationEmailSent"`
|
2025-03-11 14:16:42 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ApiKeyResponseDto struct {
|
|
|
|
|
ApiKey ApiKeyDto `json:"apiKey"`
|
|
|
|
|
Token string `json:"token"`
|
|
|
|
|
}
|