Skip to content

Commit bb60264

Browse files
committed
Fix type hints
- Type hints were in the wrong place - Protocol type hints seem to have to be fully qualified (at least when used with potemkin - Remove typehints where not needed
1 parent d82e24c commit bb60264

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/saml20_clj/coerce.clj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,38 +45,38 @@
4545

4646
(defprotocol CoerceToPrivateKey
4747
(->PrivateKey
48-
^PrivateKey [this]
49-
^PrivateKey [this ^String algorithm]
48+
[this]
49+
[this ^String algorithm]
5050
"Coerce something such as a base-64-encoded string or byte array to a `PrivateKey`. This isn't used directly by
5151
OpenSAML -- the key must be passed as part of an OpenSAML `Credential`. See `->Credential`."))
5252

5353
(defprotocol CoerceToX509Certificate
54-
(->X509Certificate ^X509Certificate [this]
54+
(^java.security.cert.X509Certificate ->X509Certificate [this]
5555
"Coerce something such as a base-64-encoded string or byte array to a `java.security.cert.X509Certificate`. This
5656
class isn't used directly by OpenSAML; instead, certificate must be coerced to an OpenSAML `Credential`. See
5757
`->Credential`."))
5858

5959
(defprotocol CoerceToCredential
6060
(->Credential
61-
^Credential [this]
62-
^Credential [public-key private-key]
61+
[this]
62+
[public-key private-key]
6363
"Coerce something such as a byte array or base-64-encoded String to an OpenSAML `Credential`. Typically, you'd use
6464
the credential with just the public key for the IdP's credentials, for encrypting requests (in combination with SP
6565
credentails) or verifying signature(s) in the response. A credential with both public and private keys would
6666
typically contain *your* public and private keys, for encrypting requests (in combination with IdP credentials) or
6767
for decrypting encrypted assertions in the response."))
6868

6969
(defprotocol CoerceToElement
70-
(->Element ^Element [this]))
70+
(^org.w3c.dom.Element ->Element [this]))
7171

7272
(defprotocol CoerceToSAMLObject
73-
(->SAMLObject ^SignableSAMLObject [this]))
73+
(^org.opensaml.saml.common.SignableSAMLObject ->SAMLObject [this]))
7474

7575
(defprotocol CoerceToResponse
76-
(->Response ^Response [this]))
76+
(^org.opensaml.saml.saml2.core.Response ->Response [this]))
7777

7878
(defprotocol SerializeXMLString
79-
(->xml-string ^String [this]))
79+
(^String ->xml-string [this]))
8080

8181

8282
;;; ------------------------------------------------------ Impl ------------------------------------------------------
@@ -212,7 +212,7 @@
212212
(when-let [keystore (keystore m)]
213213
(KeyStoreX509CredentialAdapter. keystore key-alias (.toCharArray password)))))
214214
([m private-key]
215-
(let [credential (->Credential m)
215+
(let [credential ^Credential (->Credential m)
216216
public-key (.getPublicKey credential)]
217217
(->Credential public-key private-key))))
218218

0 commit comments

Comments
 (0)