821{
822 int line_num = hbaline->linenumber;
823 const char *file_name = hbaline->sourcefile;
824 char *rawstring;
826
827 *err_msg = NULL;
828
830 {
832 errcode(ERRCODE_CONFIG_FILE_ERROR),
833 errmsg(
"oauth_validator_libraries must be set for authentication method %s",
834 "oauth"),
835 errcontext(
"line %d of configuration file \"%s\"",
836 line_num, file_name));
837 *err_msg =
psprintf(
"oauth_validator_libraries must be set for authentication method %s",
838 "oauth");
839 return false;
840 }
841
842
844
846 {
847
849 errcode(ERRCODE_CONFIG_FILE_ERROR),
850 errmsg(
"invalid list syntax in parameter \"%s\"",
851 "oauth_validator_libraries"));
852 *err_msg =
psprintf(
"invalid list syntax in parameter \"%s\"",
853 "oauth_validator_libraries");
854 goto done;
855 }
856
857 if (!hbaline->oauth_validator)
858 {
859 if (elemlist->
length == 1)
860 {
862 goto done;
863 }
864
866 errcode(ERRCODE_CONFIG_FILE_ERROR),
867 errmsg(
"authentication method \"oauth\" requires argument \"validator\" to be set when oauth_validator_libraries contains multiple options"),
868 errcontext(
"line %d of configuration file \"%s\"",
869 line_num, file_name));
870 *err_msg = "authentication method \"oauth\" requires argument \"validator\" to be set when oauth_validator_libraries contains multiple options";
871 goto done;
872 }
873
875 {
876 if (strcmp(allowed, hbaline->oauth_validator) == 0)
877 goto done;
878 }
879
881 errcode(ERRCODE_INVALID_PARAMETER_VALUE),
882 errmsg(
"validator \"%s\" is not permitted by %s",
883 hbaline->oauth_validator, "oauth_validator_libraries"),
884 errcontext(
"line %d of configuration file \"%s\"",
885 line_num, file_name));
886 *err_msg =
psprintf(
"validator \"%s\" is not permitted by %s",
887 hbaline->oauth_validator, "oauth_validator_libraries");
888
889done:
892
893 return (*err_msg == NULL);
894}
char * oauth_validator_libraries_string
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
void list_free_deep(List *list)
char * pstrdup(const char *in)
void pfree(void *pointer)
#define foreach_ptr(type, var, lst)
char * psprintf(const char *fmt,...)
bool SplitDirectoriesString(char *rawstring, char separator, List **namelist)