]> begriffs open source - ai-pg/blob - full-docs/txt/oauth-validator-init.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / oauth-validator-init.txt
1
2 50.2. Initialization Functions #
3
4    OAuth validator modules are dynamically loaded from the shared
5    libraries listed in oauth_validator_libraries. Modules are loaded on
6    demand when requested from a login in progress. The normal library
7    search path is used to locate the library. To provide the validator
8    callbacks and to indicate that the library is an OAuth validator module
9    a function named _PG_oauth_validator_module_init must be provided. The
10    return value of the function must be a pointer to a struct of type
11    OAuthValidatorCallbacks, which contains a magic number and pointers to
12    the module's token validation functions. The returned pointer must be
13    of server lifetime, which is typically achieved by defining it as a
14    static const variable in global scope.
15 typedef struct OAuthValidatorCallbacks
16 {
17     uint32        magic;            /* must be set to PG_OAUTH_VALIDATOR_MAGIC *
18 /
19
20     ValidatorStartupCB startup_cb;
21     ValidatorShutdownCB shutdown_cb;
22     ValidatorValidateCB validate_cb;
23 } OAuthValidatorCallbacks;
24
25 typedef const OAuthValidatorCallbacks *(*OAuthValidatorModuleInit) (void);
26
27    Only the validate_cb callback is required, the others are optional.