| Class: | Api.Auth.Models.RemoteServiceToken |
|---|---|
| Assembly: | Api |
| File(s): | /home/runner/work/ProjectRead.ing/ProjectRead.ing/Api/Auth/Models/RemoteServiceToken.cs |
| Covered lines: | 1 |
|---|---|
| Uncovered lines: | 0 |
| Coverable lines: | 1 |
| Total lines: | 30 |
| Line coverage: | 100% |
| Covered branches: | 0 |
|---|---|
| Total branches: | 0 |
| Branch coverage: | N/A |
Feature is only available for sponsors
Upgrade to PRO version| Method | Branch coverage | Crap Score | Cyclomatic complexity | Line coverage |
|---|---|---|---|---|
| .ctor() | 100% | 1 | 1 | 100% |
| # | Line | Line coverage | ||
|---|---|---|---|---|
1 | // SPDX-FileCopyrightText: 2026 Alper Çelik <[email protected]> | |||
2 | // | |||
3 | // SPDX-License-Identifier: AGPL-3.0-or-later | |||
4 | | |||
5 | using System.ComponentModel.DataAnnotations; | |||
6 | using System.ComponentModel.DataAnnotations.Schema; | |||
7 | using NodaTime; | |||
8 | | |||
9 | namespace Api.Auth.Models; | |||
10 | | |||
11 | [Table("remote_service_tokens")] | |||
12 | public class RemoteServiceToken : ITokenTime | |||
13 | { | |||
14 | public const string ServiceIdentifierType = "ServiceIdentifierType"; | |||
15 | public const string ServiceAllowedJobsType = "ServiceAllowedJobsType"; | |||
16 | public const string ServiceImpersonatedUserHeader = "as_user"; | |||
17 | | |||
18 | [Key] | |||
19 | public required byte[] TokenHash { get; set; } | |||
20 | | |||
21 | [ForeignKey(nameof(RemoteService))] | |||
22 | public Guid RemoteServiceId { get; set; } | |||
23 | | |||
24 | public Instant CreationTime { get; set; } | |||
25 | | |||
26 | public Instant? LastUsed { get; set; } | |||
27 | | |||
28 | // Navigation Properties | |||
| 1 | 29 | public RemoteService RemoteService { get; set; } = null!; | ||
30 | } |