Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) CreateDBUser(ctx context.Context, dbName string, newUser NewUser) (User, error)
- func (c *Client) DeleteDBUser(ctx context.Context, dbName, userName string) error
- func (c *Client) GetDBUser(ctx context.Context, dbName, userName string) (User, error)
- func (c *Client) ListAllUsers(ctx context.Context, filter any) ([]User, error)
- func (c *Client) ListDBUsers(ctx context.Context, dbName string, filter any) ([]User, error)
- func (c *Client) UpdateDBUser(ctx context.Context, dbName string, update UpdateUser) (User, error)
- type CommandResponse
- type Credentials
- type Mechanism
- type NewUser
- type RoleDBRef
- type RoleRef
- type RoleSameDBRef
- type UpdateUser
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("not found") ErrNotOK = errors.New("not ok") AppName = "terraform-provider-mongodb-driver" )
View Source
var Mechanisms = []Mechanism{ MechanismSCRAMSHA1, MechanismSCRAMSHA256, MechanismMONGODBX509, MechanismPLAIN, MechanismGSSAPI, }
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(uri string, cred Credentials) *Client
func (*Client) CreateDBUser ¶
func (*Client) DeleteDBUser ¶
func (*Client) ListAllUsers ¶
func (*Client) ListDBUsers ¶
func (*Client) UpdateDBUser ¶
type CommandResponse ¶
type Credentials ¶
type Mechanism ¶
type Mechanism string
Mechanism is the mechanism for user authentication.
const ( // MechanismSCRAMSHA1 is the SCRAM mechanism for creating SCRAM user credentials. // // RFC 5802 standard Salted Challenge Response Authentication Mechanism using the SHA-1 hash function. // // - Uses the SHA-1 hashing function. // // [https://www.mongodb.com/docs/manual/core/security-scram/#std-label-authentication-scram-sha-1] MechanismSCRAMSHA1 Mechanism = "SCRAM-SHA-1" // MechanismSCRAMSHA256 is the SCRAM mechanism for creating SCRAM user credentials. // // RFC 7677 standard Salted Challenge Response Authentication Mechanism using the SHA-256 hash function. // // - Uses the SHA-256 hashing function. // - Requires featureCompatibilityVersion set to 4.0. // - Requires digestPassword to be true. // // [https://www.mongodb.com/docs/manual/core/security-scram/#std-label-authentication-scram-sha-256] MechanismSCRAMSHA256 Mechanism = "SCRAM-SHA-256" // MechanismMONGODBX509 is the mechanism for MongoDB TLS/SSL certificate authentication. // // [https://www.mongodb.com/docs/manual/core/security-x.509/#std-label-security-auth-x509] MechanismMONGODBX509 Mechanism = "MONGODB-X509" // MechanismPLAIN is the mechanism for external authentication using LDAP. // You can also use PLAIN for authenticating in-database users. // PLAIN transmits passwords in plain text. // This mechanism is available only in MongoDB Enterprise. // // [https://www.mongodb.com/docs/manual/core/authentication/#std-label-security-auth-ldap] MechanismPLAIN Mechanism = "PLAIN" // MechanismGSSAPI is the mechanism for external authentication using Kerberos. // This mechanism is available only in MongoDB Enterprise. // // [https://www.mongodb.com/docs/manual/core/authentication/#std-label-security-auth-kerberos] MechanismGSSAPI Mechanism = "GSSAPI" )
type RoleSameDBRef ¶
type RoleSameDBRef string
RoleSameDBRef is a RoleRef that points to a role in the same database.
type UpdateUser ¶
Click to show internal directories.
Click to hide internal directories.