Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/crewjam/saml
/ functions
Functions
2,436 in github.com/crewjam/saml
⨍
Functions
2,436
◇
Types & classes
281
↓ 325 callers
Method
String
()
time.go:40
↓ 277 callers
Method
Get
Get fetches the data stored in `key` and unmarshals it into `value`.
samlidp/store.go:11
↓ 222 callers
Method
Len
()
samlidp/session_expiry.go:36
↓ 197 callers
Method
New
New creates a Session from the SAML assertion.
samlsp/session.go:58
↓ 190 callers
Method
Element
Element returns an etree.Element representing the object in XML form.
schema.go:440
↓ 182 callers
Function
spcovSetup
spcovSetup pins TimeNow, Clock and RandReader (restoring them afterwards) and returns a service provider that trusts a programmatically built IDP.
sp_coverage_helpers_test.go:41
↓ 165 callers
Method
Error
()
errors.go:173
↓ 128 callers
Function
mustParseURL
(s string)
samlsp/samlsp_test.go:24
↓ 98 callers
Method
ServeHTTP
ServeHTTP implements http.Handler and serves the SAML-specific HTTP endpoints on the URIs specified by m.ServiceProvider.MetadataURL, m.ServiceProvide
samlsp/middleware.go:115
↓ 96 callers
Function
spcovSerialize
(t *testing.T, el *etree.Element)
sp_coverage_helpers_test.go:177
↓ 86 callers
Method
Encode
Encode returns a serialized version of the Session. Note: When implementing this function, it is reasonable to expect that Session is of the exact ty
samlsp/session.go:64
↓ 81 callers
Method
Metadata
Metadata returns the service provider metadata
service_provider.go:562
↓ 81 callers
Function
spcovPrivateErr
spcovPrivateErr asserts err is an *InvalidResponseError and returns its PrivateErr.
sp_coverage_helpers_test.go:212
↓ 78 callers
Function
classify
(err error, kinds ...error)
errors.go:179
↓ 70 callers
Method
Header
()
samlsp/middleware_soap_logout.go:69
↓ 70 callers
Function
NewIdentityProviderTest
(t *testing.T, opts ...idpTestOpts)
identity_provider_test.go:100
↓ 69 callers
Method
assertion
()
sp_coverage_helpers_test.go:110
↓ 66 callers
Function
NewServiceProviderTest
(t *testing.T)
service_provider_test.go:64
↓ 63 callers
Method
idpSign
(t *testing.T, el *etree.Element)
sp_coverage_helpers_test.go:105
↓ 61 callers
Method
Bytes
Bytes returns a byte array representation of the LogoutRequest
schema.go:295
↓ 61 callers
Method
ParseResponse
ParseResponse extracts the SAML IDP response received in req, resolves artifacts when necessary, validates it, and returns the verified assertion. req
service_provider.go:1323
↓ 60 callers
Method
Header
()
samlidp/samlidp_coverage_test.go:79
↓ 58 callers
Method
Validate
Validate checks that the authentication request is valid and assigns the AuthnRequest and Metadata properties. Returns a non-nil error if the request
identity_provider.go:1095
↓ 52 callers
Method
MakeAuthenticationRequest
MakeAuthenticationRequest produces a new AuthnRequest object to send to the idpURL that uses the specified binding (HTTPRedirectBinding or HTTPPostBin
service_provider.go:979
↓ 52 callers
Method
ParseXMLResponse
ParseXMLResponse parses and validates the SAML IDP response and returns the verified assertion. This function handles decrypting the message, verifyi
service_provider.go:1569
↓ 51 callers
Function
NewMiddlewareTest
(t *testing.T)
samlsp/middleware_test.go:60
↓ 45 callers
Method
response
()
sp_coverage_helpers_test.go:138
↓ 44 callers
Method
Algorithm
()
xmlenc/xmlenc.go:35
↓ 42 callers
Method
MakeAssertion
MakeAssertion constructs an assertion from session and the request and assigns it to req.Assertion.
identity_provider.go:112
↓ 41 callers
Method
ServeSSO
ServeSSO handles SAML auth requests. When it gets a request for a user that does not have a valid session, then it prompts the user via XXX. If the
identity_provider.go:772
↓ 40 callers
Method
logoutRequest
()
redirect_binding_test.go:88
↓ 39 callers
Method
Encrypt
(key interface{}, plaintext []byte, nonce []byte)
xmlenc/xmlenc.go:26
↓ 39 callers
Function
covNewServer
covNewServer creates a Server backed by store, pinning time/randomness.
samlidp/samlidp_coverage_test.go:127
↓ 39 callers
Function
newSLOTest
(t *testing.T)
identity_provider_logout_test.go:64
↓ 38 callers
Method
login
login creates the user and logs them in, returning the session and the session cookie.
samlidp/logout_test.go:57
↓ 36 callers
Function
NewServerTest
(t *testing.T)
samlidp/samlidp_test.go:78
↓ 36 callers
Method
Redirect
Redirect returns a URL suitable for using the redirect binding with the request. If sp.SignatureMethod is set, the query string is signed as described
service_provider.go:712
↓ 35 callers
Method
MakeRedirectAuthenticationRequest
MakeRedirectAuthenticationRequest creates a SAML authentication request using the HTTP-Redirect binding. It returns a URL that we will redirect the us
service_provider.go:700
↓ 34 callers
Method
Printf
Printf prints to the logger using the format.
logger/logger.go:12
↓ 34 callers
Function
newLogoutTest
newLogoutTest returns a middleware whose IDP supports single logout with the given bindings, and which trusts ../testdata/idp_cert.pem.
samlsp/middleware_logout_test.go:44
↓ 33 callers
Method
Decode
Decode parses the serialized session that may have been returned by Encode and returns a Session.
samlsp/session.go:68
↓ 32 callers
Method
MakeLogoutRequest
MakeLogoutRequest produces a new LogoutRequest object for idpURL. If sp.SignatureMethod is set, the request carries an enveloped XML signature, which
service_provider.go:2857
↓ 32 callers
Function
idpcovNewTest
idpcovNewTest wraps NewIdentityProviderTest and restores the package globals it mutates once the test finishes.
idp_coverage_test.go:35
↓ 32 callers
Function
mustParsePrivateKey
(pemStr []byte)
samlsp/samlsp_test.go:32
↓ 31 callers
Function
mustParseCertificate
(pemStr []byte)
samlsp/samlsp_test.go:44
↓ 31 callers
Method
serve
(r *http.Request)
identity_provider_logout_test.go:142
↓ 31 callers
Function
unmarshalElement
unmarshalElement serializes el into v by serializing el and then parsing it with xml.Unmarshal. el is untrusted: attribute fields are read only from
service_provider.go:3880
↓ 30 callers
Function
OAEP
OAEP returns a version of RSA that implements RSA in OAEP-MGF1P mode. By default the block cipher used is AES-256 CBC and the digest method is SHA-256
xmlenc/pubkey.go:177
↓ 29 callers
Method
Write
([]byte)
samlidp/samlidp_coverage_test.go:86
↓ 29 callers
Function
aqSetup
aqSetup returns the spcovSetup environment with an IdP that also publishes an AttributeAuthorityDescriptor.
service_provider_attribute_query_test.go:38
↓ 29 callers
Method
now
now returns the current time as seen by this ServiceProvider.
service_provider.go:529
↓ 28 callers
Function
newPropagationTest
(t *testing.T)
identity_provider_logout_propagation_test.go:82
↓ 28 callers
Method
sessionCookie
sessionCookie returns a session cookie for alice, with the given SessionIndexes.
samlsp/middleware_logout_test.go:101
↓ 27 callers
Function
Decrypt
Decrypt decrypts the encrypted data using the provided key. If the data are encrypted using AES, then the key should be a []byte. If the data are encr
xmlenc/decrypt.go:78
↓ 26 callers
Method
GetSSOBindingLocation
GetSSOBindingLocation returns URL for the IDP's Single Sign On Service binding of the specified type (HTTPRedirectBinding, HTTPPostBinding or HTTPPost
service_provider.go:728
↓ 26 callers
Function
NewIdpAuthnRequest
NewIdpAuthnRequest returns a new IdpAuthnRequest for the given HTTP request to the authorization service. A GET request carries the request with the
identity_provider.go:978
↓ 24 callers
Method
Fatalf
Fatalf is equivalent to Printf() followed by a call to os.Exit(1).
logger/logger.go:20
↓ 24 callers
Function
Validate
Validate returns an error if any token of data does not survive a round trip through encoding/xml unchanged, or if data nests elements more than MaxDe
internal/xmlroundtrip/validate.go:85
↓ 24 callers
Method
redirectRequest
redirectRequest returns an HTTP request carrying req with the HTTP-Redirect binding, signed with a query string signature if the SP has a SignatureMet
identity_provider_logout_test.go:111
↓ 23 callers
Method
RequireAccount
RequireAccount is HTTP middleware that requires that each request be associated with a valid session. If the request is not associated with a valid se
samlsp/middleware.go:207
↓ 23 callers
Method
aqQuery
(t *testing.T)
service_provider_attribute_query_test.go:47
↓ 23 callers
Function
idpErrNewTest
idpErrNewTest returns an IdP test whose SP trusts the IdP's (expired) test certificate, so that the SP can parse what the IdP sends.
idp_error_response_test.go:19
↓ 20 callers
Method
GetSLOBindingLocation
GetSLOBindingLocation returns URL for the IDP's Single Log Out Service binding of the specified type (HTTPRedirectBinding or HTTPPostBinding), or "" i
service_provider.go:774
↓ 20 callers
Method
ParseLogoutResponse
ParseLogoutResponse validates the LogoutResponse content from the request, which may use the HTTP-Redirect, HTTP-POST or HTTP-POST-SimpleSign binding,
service_provider.go:3326
↓ 20 callers
Method
ParseXMLAttributeQueryResponse
ParseXMLAttributeQueryResponse validates soapResponseXML, the SOAP envelope an attribute authority returned for query, and returns the attributes it c
service_provider_attribute_query.go:260
↓ 19 callers
Method
Close
()
flate.go:41
↓ 19 callers
Method
Fatal
Fatal is equivalent to Print() followed by a call to os.Exit(1).
logger/logger.go:18
↓ 19 callers
Function
New
New creates a new Middleware with the default providers for the given options. You can customize the behavior of the middleware in more detail by rep
samlsp/new.go:551
↓ 19 callers
Method
specSigParse
(t *testing.T, responseEl *etree.Element)
spec_signature_encryption_test.go:163
↓ 19 callers
Method
validateAssertion
(assertion *Assertion, possibleRequestIDs []string, now time.Time)
service_provider.go:2164
↓ 18 callers
Method
Decrypt
(key interface{}, ciphertextEl *etree.Element)
xmlenc/xmlenc.go:36
↓ 18 callers
Method
GetSession
GetSession returns the current Session associated with the request, or an error matching ErrNoSession (as determined by errors.Is) if there is no vali
samlsp/session.go:51
↓ 18 callers
Function
IsNil
IsNil reports whether key is nil, or is a non-nil interface holding a nil value such as (*rsa.PrivateKey)(nil) or a nil ed25519.PrivateKey. A plain ==
internal/signerutil/signerutil.go:12
↓ 18 callers
Method
RedirectLogoutRequestURL
RedirectLogoutRequestURL returns the URL that sends req to its Destination with the HTTP-Redirect binding. Use it instead of MakeRedirectLogoutRequest
service_provider.go:2975
↓ 18 callers
Function
WithSessionIndex
WithSessionIndex sets the SessionIndex element of a LogoutRequest, which identifies the session at the IDP to terminate (saml-core-2.0-os section 3.7.
service_provider.go:2827
↓ 17 callers
Method
HandleStartLogout
HandleStartLogout starts SP initiated single logout. It deletes the local session and sends the browser to the IDP with a LogoutRequest for the sessio
samlsp/middleware_logout.go:71
↓ 17 callers
Method
ServeIDPInitiated
ServeIDPInitiated handes an IDP-initiated authorization request. Requests of this type require us to know a registered service provider and (optionall
identity_provider.go:842
↓ 17 callers
Method
ValidateLogoutRequest
ValidateLogoutRequest validates a LogoutRequest sent by the IDP (IDP initiated single logout), using the HTTP-Redirect, HTTP-POST or HTTP-POST-SimpleS
service_provider.go:3538
↓ 17 callers
Method
aqSOAP
(t *testing.T, query *AttributeQuery, o aqOptions)
service_provider_attribute_query_test.go:119
↓ 17 callers
Function
assertSessionDeleted
assertSessionDeleted checks that resp expires the session cookie.
samlsp/middleware_logout_test.go:198
↓ 17 callers
Function
postForm
postForm posts the hidden fields of form to its action and returns the parsed request.
simplesign_idp_test.go:55
↓ 17 callers
Function
simpleSignPost
simpleSignPost returns a parsed POST request to target carrying v.
simplesign_binding_test.go:57
↓ 17 callers
Function
spcovSOAPEnvelope
(body *etree.Element)
sp_coverage_helpers_test.go:204
↓ 17 callers
Function
validAssertion
validAssertion is an assertion that validateAssertion accepts for requiredConditionsSP, so each test removes exactly one part of it.
required_conditions_test.go:14
↓ 16 callers
Method
Error
()
xmlenc/decrypt.go:47
↓ 16 callers
Function
ParseRedirectRequest
ParseRedirectRequest returns the decoded SAML AuthnRequest from an HTTP-Redirect URL
testsaml/parse.go:25
↓ 16 callers
Method
postToSLO
(form url.Values, cookies ...*http.Cookie)
samlsp/middleware_logout_test.go:138
↓ 16 callers
Function
requiredConditionsSP
()
required_conditions_test.go:34
↓ 16 callers
Method
startLogout
startLogout calls HandleStartLogout with cookie and ctx.
samlsp/soap_start_logout_test.go:166
↓ 15 callers
Method
Put
Put marshals `value` and stores it in `key`.
samlidp/store.go:14
↓ 15 callers
Method
WriteHeader
(code int)
samlidp/samlidp_coverage_test.go:90
↓ 15 callers
Function
covServe
covServe runs a request through the server's mux and returns the status code.
samlidp/handlers_coverage_test.go:16
↓ 15 callers
Function
elementToBytes
elementToBytes serializes el as a standalone document. Namespace declarations that el inherits from its ancestors are copied onto the serialized root,
service_provider.go:3826
↓ 15 callers
Method
specSigResponse
specSigResponse wraps the given assertion-level children in an unsigned Response built from e.response().
spec_signature_encryption_test.go:155
↓ 14 callers
Method
List
List returns all the keys that start with `prefix`. The prefix is stripped from each returned value. So if keys are ["aa", "ab", "cd"] then List("a")
samlidp/store.go:22
↓ 14 callers
Method
MakeResponse
MakeResponse creates and assigns a new SAML response in ResponseEl. `Assertion` must be non-nil. If MakeAssertionEl() has not been called, this functi
identity_provider.go:1875
↓ 14 callers
Method
addSOAPParticipant
addSOAPParticipant adds to pt an SP that lists an https SOAP SingleLogoutService after the given front-channel bindings. Unless pt.idp already has an
identity_provider_logout_soap_test.go:42
↓ 14 callers
Method
encryptedAssertion
encryptedAssertion encrypts plaintext for the SP and wraps it in an EncryptedAssertion.
sp_coverage_helpers_test.go:163
↓ 14 callers
Method
logoutRequest
()
samlsp/middleware_logout_test.go:186
↓ 14 callers
Function
newKeyAndCert
newKeyAndCert returns an RSA key and a self-signed certificate for it, as Encrypt takes the recipient's certificate and Decrypt its key.
xmlenc/key_transport_test.go:18
next →
1–100 of 2,436, ranked by callers