MetadataBLOBPayloadEntry.java

1
package com.yubico.fido.metadata;
2
3
import com.yubico.internal.util.CollectionUtil;
4
import com.yubico.webauthn.data.ByteArray;
5
import java.net.URL;
6
import java.time.LocalDate;
7
import java.util.Collections;
8
import java.util.List;
9
import java.util.Optional;
10
import java.util.Set;
11
import java.util.stream.Collectors;
12
import lombok.Builder;
13
import lombok.NonNull;
14
import lombok.Value;
15
import lombok.extern.jackson.Jacksonized;
16
17
/**
18
 * An element of {@link MetadataBLOBPayload#getEntries() entries} in a {@link MetadataBLOBPayload}.
19
 *
20
 * @see <a
21
 *     href="https://fidoalliance.org/specs/mds/fido-metadata-service-v3.0-ps-20210518.html#metadata-blob-payload-entry-dictionary">FIDO
22
 *     Metadata Service §3.1.1. Metadata BLOB Payload Entry dictionary</a>
23
 */
24
@Value
25
@Builder(toBuilder = true)
26
@Jacksonized
27
public class MetadataBLOBPayloadEntry {
28
29
  /**
30
   * @see <a
31
   *     href="https://fidoalliance.org/specs/mds/fido-metadata-service-v3.0-ps-20210518.html#metadata-blob-payload-entry-dictionary">FIDO
32
   *     Metadata Service §3.1.1. Metadata BLOB Payload Entry dictionary</a>
33
   */
34
  AAID aaid;
35
36
  /**
37
   * @see <a
38
   *     href="https://fidoalliance.org/specs/mds/fido-metadata-service-v3.0-ps-20210518.html#metadata-blob-payload-entry-dictionary">FIDO
39
   *     Metadata Service §3.1.1. Metadata BLOB Payload Entry dictionary</a>
40
   */
41
  AAGUID aaguid;
42
43
  /**
44
   * @see <a
45
   *     href="https://fidoalliance.org/specs/mds/fido-metadata-service-v3.0-ps-20210518.html#metadata-blob-payload-entry-dictionary">FIDO
46
   *     Metadata Service §3.1.1. Metadata BLOB Payload Entry dictionary</a>
47
   */
48
  Set<String> attestationCertificateKeyIdentifiers;
49
50
  /**
51
   * @see <a
52
   *     href="https://fidoalliance.org/specs/mds/fido-metadata-service-v3.0-ps-20210518.html#metadata-blob-payload-entry-dictionary">FIDO
53
   *     Metadata Service §3.1.1. Metadata BLOB Payload Entry dictionary</a>
54
   */
55
  MetadataStatement metadataStatement;
56
57
  /**
58
   * @see <a
59
   *     href="https://fidoalliance.org/specs/mds/fido-metadata-service-v3.0-ps-20210518.html#metadata-blob-payload-entry-dictionary">FIDO
60
   *     Metadata Service §3.1.1. Metadata BLOB Payload Entry dictionary</a>
61
   */
62
  List<BiometricStatusReport> biometricStatusReports;
63
64
  /**
65
   * @see <a
66
   *     href="https://fidoalliance.org/specs/mds/fido-metadata-service-v3.0-ps-20210518.html#metadata-blob-payload-entry-dictionary">FIDO
67
   *     Metadata Service §3.1.1. Metadata BLOB Payload Entry dictionary</a>
68
   */
69
  @NonNull List<StatusReport> statusReports;
70
71
  /**
72
   * @see <a
73
   *     href="https://fidoalliance.org/specs/mds/fido-metadata-service-v3.0-ps-20210518.html#metadata-blob-payload-entry-dictionary">FIDO
74
   *     Metadata Service §3.1.1. Metadata BLOB Payload Entry dictionary</a>
75
   */
76
  @NonNull LocalDate timeOfLastStatusChange;
77
78
  /**
79
   * @see <a
80
   *     href="https://fidoalliance.org/specs/mds/fido-metadata-service-v3.0-ps-20210518.html#metadata-blob-payload-entry-dictionary">FIDO
81
   *     Metadata Service §3.1.1. Metadata BLOB Payload Entry dictionary</a>
82
   */
83
  URL rogueListURL;
84
85
  /**
86
   * @see <a
87
   *     href="https://fidoalliance.org/specs/mds/fido-metadata-service-v3.0-ps-20210518.html#metadata-blob-payload-entry-dictionary">FIDO
88
   *     Metadata Service §3.1.1. Metadata BLOB Payload Entry dictionary</a>
89
   */
90
  ByteArray rogueListHash;
91
92
  private MetadataBLOBPayloadEntry(
93
      AAID aaid,
94
      AAGUID aaguid,
95
      Set<String> attestationCertificateKeyIdentifiers,
96
      MetadataStatement metadataStatement,
97
      List<BiometricStatusReport> biometricStatusReports,
98 1 1. <init> : negated conditional → KILLED
      @NonNull List<StatusReport> statusReports,
99 1 1. <init> : negated conditional → KILLED
      @NonNull LocalDate timeOfLastStatusChange,
100
      URL rogueListURL,
101
      ByteArray rogueListHash) {
102
    this.aaid = aaid;
103
    this.aaguid = aaguid;
104
    this.attestationCertificateKeyIdentifiers =
105
        CollectionUtil.immutableSetOrEmpty(attestationCertificateKeyIdentifiers);
106
    this.metadataStatement = metadataStatement;
107
    this.biometricStatusReports = CollectionUtil.immutableListOrEmpty(biometricStatusReports);
108
    this.statusReports =
109
        Collections.unmodifiableList(
110
            statusReports.stream()
111
                .filter(
112 2 1. lambda$new$0 : replaced boolean return with true for com/yubico/fido/metadata/MetadataBLOBPayloadEntry::lambda$new$0 → KILLED
2. lambda$new$0 : negated conditional → KILLED
                    statusReport -> !statusReport.getStatus().equals(AuthenticatorStatus.UNKNOWN))
113
                .collect(Collectors.toList()));
114
    this.timeOfLastStatusChange = timeOfLastStatusChange;
115
    this.rogueListURL = rogueListURL;
116
    this.rogueListHash = rogueListHash;
117
  }
118
119
  /**
120
   * @see <a
121
   *     href="https://fidoalliance.org/specs/mds/fido-metadata-service-v3.0-ps-20210518.html#metadata-blob-payload-entry-dictionary">FIDO
122
   *     Metadata Service §3.1.1. Metadata BLOB Payload Entry dictionary</a>
123
   */
124
  public Optional<AAID> getAaid() {
125 1 1. getAaid : replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataBLOBPayloadEntry::getAaid → KILLED
    return Optional.ofNullable(this.aaid);
126
  }
127
128
  /**
129
   * @see <a
130
   *     href="https://fidoalliance.org/specs/mds/fido-metadata-service-v3.0-ps-20210518.html#metadata-blob-payload-entry-dictionary">FIDO
131
   *     Metadata Service §3.1.1. Metadata BLOB Payload Entry dictionary</a>
132
   */
133
  public Optional<AAGUID> getAaguid() {
134 1 1. getAaguid : replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataBLOBPayloadEntry::getAaguid → KILLED
    return Optional.ofNullable(this.aaguid);
135
  }
136
137
  /**
138
   * @see <a
139
   *     href="https://fidoalliance.org/specs/mds/fido-metadata-service-v3.0-ps-20210518.html#metadata-blob-payload-entry-dictionary">FIDO
140
   *     Metadata Service §3.1.1. Metadata BLOB Payload Entry dictionary</a>
141
   */
142
  public Optional<MetadataStatement> getMetadataStatement() {
143 1 1. getMetadataStatement : replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataBLOBPayloadEntry::getMetadataStatement → KILLED
    return Optional.ofNullable(this.metadataStatement);
144
  }
145
146
  /**
147
   * @see <a
148
   *     href="https://fidoalliance.org/specs/mds/fido-metadata-service-v3.0-ps-20210518.html#metadata-blob-payload-entry-dictionary">FIDO
149
   *     Metadata Service §3.1.1. Metadata BLOB Payload Entry dictionary</a>
150
   */
151
  public Optional<LocalDate> getTimeOfLastStatusChange() {
152 1 1. getTimeOfLastStatusChange : replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataBLOBPayloadEntry::getTimeOfLastStatusChange → KILLED
    return Optional.of(this.timeOfLastStatusChange);
153
  }
154
155
  /**
156
   * @see <a
157
   *     href="https://fidoalliance.org/specs/mds/fido-metadata-service-v3.0-ps-20210518.html#metadata-blob-payload-entry-dictionary">FIDO
158
   *     Metadata Service §3.1.1. Metadata BLOB Payload Entry dictionary</a>
159
   */
160
  public Optional<URL> getRogueListURL() {
161 1 1. getRogueListURL : replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataBLOBPayloadEntry::getRogueListURL → SURVIVED
    return Optional.ofNullable(this.rogueListURL);
162
  }
163
164
  /**
165
   * @see <a
166
   *     href="https://fidoalliance.org/specs/mds/fido-metadata-service-v3.0-ps-20210518.html#metadata-blob-payload-entry-dictionary">FIDO
167
   *     Metadata Service §3.1.1. Metadata BLOB Payload Entry dictionary</a>
168
   */
169
  public Optional<ByteArray> getRogueListHash() {
170 1 1. getRogueListHash : replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataBLOBPayloadEntry::getRogueListHash → SURVIVED
    return Optional.ofNullable(this.rogueListHash);
171
  }
172
}

Mutations

98

1.1
Location : <init>
Killed by : com.yubico.fido.metadata.FidoMds3Spec
negated conditional → KILLED

99

1.1
Location : <init>
Killed by : com.yubico.fido.metadata.FidoMds3Spec
negated conditional → KILLED

112

1.1
Location : lambda$new$0
Killed by : com.yubico.fido.metadata.FidoMds3Spec
replaced boolean return with true for com/yubico/fido/metadata/MetadataBLOBPayloadEntry::lambda$new$0 → KILLED

2.2
Location : lambda$new$0
Killed by : com.yubico.fido.metadata.FidoMds3Spec
negated conditional → KILLED

125

1.1
Location : getAaid
Killed by : com.yubico.fido.metadata.FidoMds3Spec
replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataBLOBPayloadEntry::getAaid → KILLED

134

1.1
Location : getAaguid
Killed by : com.yubico.fido.metadata.FidoMds3Spec
replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataBLOBPayloadEntry::getAaguid → KILLED

143

1.1
Location : getMetadataStatement
Killed by : com.yubico.fido.metadata.FidoMds3Spec
replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataBLOBPayloadEntry::getMetadataStatement → KILLED

152

1.1
Location : getTimeOfLastStatusChange
Killed by : com.yubico.fido.metadata.JsonIoSpec
replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataBLOBPayloadEntry::getTimeOfLastStatusChange → KILLED

161

1.1
Location : getRogueListURL
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataBLOBPayloadEntry::getRogueListURL → SURVIVED

170

1.1
Location : getRogueListHash
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataBLOBPayloadEntry::getRogueListHash → SURVIVED

Active mutators

Tests examined


Report generated by PIT 1.15.0