/
auth_provider.go
59 lines (46 loc) · 3.03 KB
/
auth_provider.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package server
import "github.com/awcullen/opcua/ua"
// UserNameIdentityAuthenticator authenticates AnonymousIdentity.
type AnonymousIdentityAuthenticator interface {
// AuthenticateUserNameIdentity returns nil when user identity is authenticated, or BadUserAccessDenied otherwise.
AuthenticateAnonymousIdentity(userIdentity ua.AnonymousIdentity, applicationURI string, endpointURL string) error
}
// AuthenticateUserNameIdentityFunc authenticates AnonymousIdentity.
type AuthenticateAnonymousIdentityFunc func(userIdentity ua.AnonymousIdentity, applicationURI string, endpointURL string) error
// AuthenticateUserNameIdentity ...
func (f AuthenticateAnonymousIdentityFunc) AuthenticateAnonymousIdentity(userIdentity ua.AnonymousIdentity, applicationURI string, endpointURL string) error {
return f(userIdentity, applicationURI, endpointURL)
}
// UserNameIdentityAuthenticator authenticates UserNameIdentity.
type UserNameIdentityAuthenticator interface {
// AuthenticateUserNameIdentity returns nil when user identity is authenticated, or BadUserAccessDenied otherwise.
AuthenticateUserNameIdentity(userIdentity ua.UserNameIdentity, applicationURI string, endpointURL string) error
}
// AuthenticateUserNameIdentityFunc authenticates UserNameIdentity.
type AuthenticateUserNameIdentityFunc func(userIdentity ua.UserNameIdentity, applicationURI string, endpointURL string) error
// AuthenticateUserNameIdentity ...
func (f AuthenticateUserNameIdentityFunc) AuthenticateUserNameIdentity(userIdentity ua.UserNameIdentity, applicationURI string, endpointURL string) error {
return f(userIdentity, applicationURI, endpointURL)
}
// X509IdentityAuthenticator authenticates X509Identity.
type X509IdentityAuthenticator interface {
// AuthenticateUser returns nil when user is authenticated, or BadUserAccessDenied otherwise.
AuthenticateX509Identity(userIdentity ua.X509Identity, applicationURI string, endpointURL string) error
}
// AuthenticateX509IdentityFunc authenticates X509Identity.
type AuthenticateX509IdentityFunc func(userIdentity ua.X509Identity, applicationURI string, endpointURL string) error
// AuthenticateX509Identity ...
func (f AuthenticateX509IdentityFunc) AuthenticateX509Identity(userIdentity ua.X509Identity, applicationURI string, endpointURL string) error {
return f(userIdentity, applicationURI, endpointURL)
}
// IssuedIdentityAuthenticator authenticates user identities.
type IssuedIdentityAuthenticator interface {
// AuthenticateIssuedIdentity returns nil when user is authenticated, or BadUserAccessDenied otherwise.
AuthenticateIssuedIdentity(userIdentity ua.IssuedIdentity, applicationURI string, endpointURL string) error
}
// AuthenticateIssuedIdentityFunc authenticates user identities.
type AuthenticateIssuedIdentityFunc func(userIdentity ua.IssuedIdentity, applicationURI string, endpointURL string) error
// AuthenticateIssuedIdentity ...
func (f AuthenticateIssuedIdentityFunc) AuthenticateIssuedIdentity(userIdentity ua.IssuedIdentity, applicationURI string, endpointURL string) error {
return f(userIdentity, applicationURI, endpointURL)
}