| 1 | // Copyright (c) 2018, Yubico AB | |
| 2 | // All rights reserved. | |
| 3 | // | |
| 4 | // Redistribution and use in source and binary forms, with or without | |
| 5 | // modification, are permitted provided that the following conditions are met: | |
| 6 | // | |
| 7 | // 1. Redistributions of source code must retain the above copyright notice, this | |
| 8 | // list of conditions and the following disclaimer. | |
| 9 | // | |
| 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, | |
| 11 | // this list of conditions and the following disclaimer in the documentation | |
| 12 | // and/or other materials provided with the distribution. | |
| 13 | // | |
| 14 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |
| 15 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
| 16 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
| 17 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |
| 18 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
| 19 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
| 20 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |
| 21 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |
| 22 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
| 23 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| 24 | ||
| 25 | package com.yubico.webauthn.data; | |
| 26 | ||
| 27 | import com.fasterxml.jackson.annotation.JsonCreator; | |
| 28 | import com.fasterxml.jackson.annotation.JsonProperty; | |
| 29 | import lombok.Builder; | |
| 30 | import lombok.Getter; | |
| 31 | import lombok.NonNull; | |
| 32 | import lombok.Value; | |
| 33 | ||
| 34 | /** | |
| 35 | * Used to supply additional Relying Party attributes when creating a new credential. | |
| 36 | * | |
| 37 | * @see <a | |
| 38 | * href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#dictdef-publickeycredentialrpentity">§5.4.2. | |
| 39 | * Relying Party Parameters for Credential Generation (dictionary PublicKeyCredentialRpEntity) | |
| 40 | * </a> | |
| 41 | */ | |
| 42 | @Value | |
| 43 | @Builder(toBuilder = true) | |
| 44 | public class RelyingPartyIdentity implements PublicKeyCredentialEntity { | |
| 45 | ||
| 46 | /** | |
| 47 | * The human-palatable name of the Relaying Party. | |
| 48 | * | |
| 49 | * <p>For example: "ACME Corporation", "Wonderful Widgets, Inc." or "ОАО Примертех". | |
| 50 | */ | |
| 51 | @NonNull | |
| 52 | @Getter(onMethod = @__({@Override})) | |
| 53 | private final String name; | |
| 54 | ||
| 55 | /** | |
| 56 | * A unique identifier for the Relying Party, which sets the <a | |
| 57 | * href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#rp-id">RP ID</a>. | |
| 58 | * | |
| 59 | * <p>This defines the domains where users' credentials are valid. See <a | |
| 60 | * href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#scope">RP ID: scope</a> for details | |
| 61 | * and examples. | |
| 62 | * | |
| 63 | * @see <a href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#rp-id">RP ID</a> | |
| 64 | * @see <a href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#scope">RP ID: scope</a> | |
| 65 | */ | |
| 66 | @NonNull private final String id; | |
| 67 | ||
| 68 | @JsonCreator | |
| 69 | private RelyingPartyIdentity( | |
| 70 |
2
1. <init> : negated conditional → KILLED 2. <init> : negated conditional → KILLED |
@NonNull @JsonProperty("name") String name, @NonNull @JsonProperty("id") String id) { |
| 71 | this.name = name; | |
| 72 | this.id = id; | |
| 73 | } | |
| 74 | ||
| 75 | public static RelyingPartyIdentityBuilder.MandatoryStages builder() { | |
| 76 |
1
1. builder : replaced return value with null for com/yubico/webauthn/data/RelyingPartyIdentity::builder → KILLED |
return new RelyingPartyIdentityBuilder.MandatoryStages(); |
| 77 | } | |
| 78 | ||
| 79 | public static class RelyingPartyIdentityBuilder { | |
| 80 | ||
| 81 | public static class MandatoryStages { | |
| 82 | private final RelyingPartyIdentityBuilder builder = new RelyingPartyIdentityBuilder(); | |
| 83 | ||
| 84 | /** | |
| 85 | * A unique identifier for the Relying Party, which sets the <a | |
| 86 | * href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#rp-id">RP ID</a>. | |
| 87 | * | |
| 88 | * <p>This defines the domains where users' credentials are valid. See <a | |
| 89 | * href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#scope">RP ID: scope</a> for | |
| 90 | * details and examples. | |
| 91 | * | |
| 92 | * @see RelyingPartyIdentityBuilder#id(String) | |
| 93 | * @see <a href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#rp-id">RP ID</a> | |
| 94 | * @see <a href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#scope">RP ID: scope</a> | |
| 95 | */ | |
| 96 | public Step2 id(String id) { | |
| 97 | builder.id(id); | |
| 98 |
1
1. id : replaced return value with null for com/yubico/webauthn/data/RelyingPartyIdentity$RelyingPartyIdentityBuilder$MandatoryStages::id → KILLED |
return new Step2(); |
| 99 | } | |
| 100 | ||
| 101 | public class Step2 { | |
| 102 | /** | |
| 103 | * The human-palatable name of the Relaying Party. | |
| 104 | * | |
| 105 | * <p>For example: "ACME Corporation", "Wonderful Widgets, Inc." or "ОАО Примертех". | |
| 106 | * | |
| 107 | * @see RelyingPartyIdentityBuilder#name(String) | |
| 108 | */ | |
| 109 | public RelyingPartyIdentityBuilder name(String name) { | |
| 110 |
1
1. name : replaced return value with null for com/yubico/webauthn/data/RelyingPartyIdentity$RelyingPartyIdentityBuilder$MandatoryStages$Step2::name → KILLED |
return builder.name(name); |
| 111 | } | |
| 112 | } | |
| 113 | } | |
| 114 | } | |
| 115 | } | |
Mutations | ||
| 70 |
1.1 2.2 |
|
| 76 |
1.1 |
|
| 98 |
1.1 |
|
| 110 |
1.1 |