Only consider x509 certs in /.well-known/jwks API

This commit is contained in:
Yang Luo 2023-07-12 22:39:39 +08:00
parent 0d48da24dc
commit caec1d1bac
3 changed files with 6 additions and 0 deletions

View File

@ -123,6 +123,10 @@ func GetJsonWebKeySet() (jose.JSONWebKeySet, error) {
// link here: https://self-issued.info/docs/draft-ietf-jose-json-web-key.html
// or https://datatracker.ietf.org/doc/html/draft-ietf-jose-json-web-key
for _, cert := range certs {
if cert.Type != "x509" {
continue
}
certPemBlock := []byte(cert.Certificate)
certDerBlock, _ := pem.Decode(certPemBlock)
x509Cert, _ := x509.ParseCertificate(certDerBlock.Bytes)

View File

@ -158,6 +158,7 @@ class CertEditPage extends React.Component {
{
[
{id: "x509", name: "x509"},
{id: "Payment", name: "Payment"},
].map((item, index) => <Option key={index} value={item.id}>{item.name}</Option>)
}
</Select>

View File

@ -151,6 +151,7 @@ class CertListPage extends BaseListPage {
filterMultiple: false,
filters: [
{text: "x509", value: "x509"},
{text: "Payment", value: "Payment"},
],
width: "110px",
sorter: true,