1 package authserver 2 3 // vncQuery is used to return all of the configuration values which could 4 // potentially be used to make a decision on vnc auth mode in a single query. 5 // The first column is the kind of config value, indicating both the table and 6 // config_key, while the second column is the config value. 7 // If a configuration value for a given banner or cluster is missing, no row 8 // will be returned. The query is a generic query that will work for both read 9 // only and read write mode, by supplying the appropriate config_key's out of 10 // (vncReadWriteAuthRequired, vncReadWriteAuthRequiredOverride) and 11 // (vncReadAuthRequired, vncReadAuthRequiredOverride) 12 const vncQuery = ` 13 SELECT 14 'banner_vnc_auth_required' as kind, config_value 15 FROM banner_configs 16 WHERE 17 banner_edge_id = $3 18 AND config_key = $1 19 UNION ALL 20 SELECT 21 'banner_vnc_override' as kind, config_value 22 FROM banner_configs 23 WHERE 24 banner_edge_id = $3 25 AND config_key = $2 26 UNION ALL 27 SELECT 28 'cluster_vnc_auth_required' as kind, config_value 29 FROM cluster_config 30 WHERE 31 cluster_edge_id = $4 32 AND config_key = $1 33 ;` 34