mirror of
https://github.com/typesense/typesense.git
synced 2025-05-18 20:52:50 +08:00
Insist on API key authentication even for search end-point.
Server can be started with a separate `--search-only-api-key` argument for exposing this key on the JS client.
This commit is contained in:
parent
6bb6f2f4b8
commit
c7eb19ca46
@ -71,7 +71,7 @@ public:
|
||||
|
||||
bool auth_key_matches(std::string auth_key_sent);
|
||||
|
||||
bool search_only_auth_key_matches(std::string auth_key_sent);
|
||||
bool search_only_auth_key_matches(const std::string & auth_key_sent);
|
||||
|
||||
Option<Collection*> create_collection(const std::string name, const std::vector<field> & fields,
|
||||
const std::string & default_sorting_field,
|
||||
|
@ -200,8 +200,8 @@ bool CollectionManager::auth_key_matches(std::string auth_key_sent) {
|
||||
return (auth_key == auth_key_sent);
|
||||
}
|
||||
|
||||
bool CollectionManager::search_only_auth_key_matches(std::string auth_key_sent) {
|
||||
return (search_only_auth_key == auth_key_sent);
|
||||
bool CollectionManager::search_only_auth_key_matches(const std::string & auth_key_sent) {
|
||||
return !auth_key_sent.empty() && (search_only_auth_key == auth_key_sent);
|
||||
}
|
||||
|
||||
Option<Collection*> CollectionManager::create_collection(const std::string name, const std::vector<field> & fields,
|
||||
|
Loading…
x
Reference in New Issue
Block a user