SCRAMPassword contains the building blocks to build a PostgreSQL SCRAM verifier. Implements the PostgresPassword interface
| 63 | // SCRAMPassword contains the building blocks to build a PostgreSQL SCRAM |
| 64 | // verifier. Implements the PostgresPassword interface |
| 65 | type 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. |
nothing calls this directly
no outgoing calls
no test coverage detected