Skip to content

Commit

Permalink
[#4] 애플 Key 응답 DTO 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
jun108059 committed Nov 3, 2021
1 parent 6629471 commit 762019b
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.teamnexters.lazy.api.config.auth.dto;

import lombok.Getter;
import lombok.Setter;

import java.util.List;
import java.util.Optional;

@Getter
@Setter
public class ApplePublicKeyResponse {
private List<Key> keys;

@Getter
@Setter
public static class Key {
private String kty;
private String kid;
private String use;
private String alg;
private String n;
private String e;
}

public Optional<Key> getMatchedKeyBy(Object kid, Object alg) {
return this.keys.stream()
.filter(key -> key.getKid().equals(kid) && key.getAlg().equals(alg))
.findFirst();
}
}

0 comments on commit 762019b

Please sign in to comment.