api_key.go 851 B

12345678910111213141516171819202122232425262728
  1. // SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
  2. // SPDX-License-Identifier: Apache-2.0
  3. package model // import "miniflux.app/v2/internal/model"
  4. import (
  5. "time"
  6. )
  7. // APIKey represents an application API key.
  8. // We need to use a pointer for LastUsedAt,
  9. // as the value obtained from the database might sometimes be nil.
  10. type APIKey struct {
  11. ID int64 `json:"id"`
  12. UserID int64 `json:"user_id"`
  13. Token string `json:"token"`
  14. Description string `json:"description"`
  15. LastUsedAt *time.Time `json:"last_used_at"`
  16. CreatedAt time.Time `json:"created_at"`
  17. }
  18. // APIKeys represents a collection of API Key.
  19. type APIKeys []APIKey
  20. // APIKeyCreationRequest represents the request to create a new API Key.
  21. type APIKeyCreationRequest struct {
  22. Description string `json:"description"`
  23. }