LCOV - code coverage report
Current view: top level - src/test/modules/oauth_validator - fail_validator.c (source / functions) Hit Total Coverage
Test: PostgreSQL 18devel Lines: 0 5 0.0 %
Date: 2025-02-22 15:15:04 Functions: 0 3 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*-------------------------------------------------------------------------
       2             :  *
       3             :  * fail_validator.c
       4             :  *    Test module for serverside OAuth token validation callbacks, which is
       5             :  *    guaranteed to always fail in the validation callback
       6             :  *
       7             :  * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
       8             :  * Portions Copyright (c) 1994, Regents of the University of California
       9             :  *
      10             :  * src/test/modules/oauth_validator/fail_validator.c
      11             :  *
      12             :  *-------------------------------------------------------------------------
      13             :  */
      14             : 
      15             : #include "postgres.h"
      16             : 
      17             : #include "fmgr.h"
      18             : #include "libpq/oauth.h"
      19             : 
      20           0 : PG_MODULE_MAGIC;
      21             : 
      22             : static bool fail_token(const ValidatorModuleState *state,
      23             :                        const char *token,
      24             :                        const char *role,
      25             :                        ValidatorModuleResult *result);
      26             : 
      27             : /* Callback implementations (we only need the main one) */
      28             : static const OAuthValidatorCallbacks validator_callbacks = {
      29             :     PG_OAUTH_VALIDATOR_MAGIC,
      30             : 
      31             :     .validate_cb = fail_token,
      32             : };
      33             : 
      34             : const OAuthValidatorCallbacks *
      35           0 : _PG_oauth_validator_module_init(void)
      36             : {
      37           0 :     return &validator_callbacks;
      38             : }
      39             : 
      40             : static bool
      41           0 : fail_token(const ValidatorModuleState *state,
      42             :            const char *token, const char *role,
      43             :            ValidatorModuleResult *res)
      44             : {
      45           0 :     elog(FATAL, "fail_validator: sentinel error");
      46             :     pg_unreachable();
      47             : }

Generated by: LCOV version 1.14