MCPcopy Create free account
hub / github.com/documentdb/documentdb / BuildResponseMsgForAuthRequest

Function BuildResponseMsgForAuthRequest

pg_documentdb/src/auth/scram256.c:808–822  ·  view source on GitHub ↗

Build the response BSON for SCRAM SHA256 AUTH request */

Source from the content-addressed store, hash-verified

806
807/* Build the response BSON for SCRAM SHA256 AUTH request */
808static pgbson *
809BuildResponseMsgForAuthRequest(ScramAuthResult *authReqResult)
810{
811 pgbson_writer resultWriter;
812
813 PgbsonWriterInit(&resultWriter);
814
815 PgbsonWriterAppendInt32(&resultWriter, AUTH_OK_KEY, AUTH_OK_KEY_LEN,
816 authReqResult->ok);
817 PgbsonWriterAppendUtf8(&resultWriter, AUTH_SERV_SIGN_KEY,
818 AUTH_SERV_SIGN_KEY_LEN,
819 authReqResult->serverSignature);
820
821 return PgbsonWriterGetPgbson(&resultWriter);
822}
823
824
825/* Build the response BSON for Auth Message and Client Proof generator test

Calls 4

PgbsonWriterInitFunction · 0.85
PgbsonWriterAppendInt32Function · 0.85
PgbsonWriterAppendUtf8Function · 0.85
PgbsonWriterGetPgbsonFunction · 0.85

Tested by

no test coverage detected