MCPcopy Create free account
hub / github.com/CrunchyData/postgres-operator / SCRAMPassword

Struct SCRAMPassword

internal/postgres/password/scram.go:65–79  ·  view source on GitHub ↗

SCRAMPassword contains the building blocks to build a PostgreSQL SCRAM verifier. Implements the PostgresPassword interface

Source from the content-addressed store, hash-verified

63// SCRAMPassword contains the building blocks to build a PostgreSQL SCRAM
64// verifier. Implements the PostgresPassword interface
65type SCRAMPassword struct {
66 // Iterations is the number of iterations to run the PBKDF2 algorithm when
67 // generating the hashed salted password. This defaults to 4096, which is the
68 // PostgreSQL default
69 Iterations int
70 // SaltLength is the length of the generated salt that is used as part of the
71 // PBKDF2 algorithm
72 SaltLength int
73 // generateSalt is a function that is used to generate a salt. This can be
74 // mocked for testing purposes
75 generateSalt func(int) ([]byte, error)
76 // password is the plaintext password. This is really the most important
77 // attribute
78 password string
79}
80
81// Build creates the SCRAM verifier, which follows the methods defined in the
82// PostgreSQL source, i.e.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected