Skip to content

Commit

Permalink
Small tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-niestadt committed Jul 2, 2024
1 parent 165b7f4 commit 7fdc368
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ public int nextDoc() throws IOException {
assert docID() != NO_MORE_DOCS;
atFirstInCurrentDoc = false;
startPos = -1;
while (true) {
in.nextDoc();
return nextMatchingDoc();
}
in.nextDoc();
return nextMatchingDoc();
}

private int nextMatchingDoc() throws IOException {
Expand Down
2 changes: 1 addition & 1 deletion site/docs/server/howtos.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ If you configure a form of user authentication, you can allow users to manager t

BlackLab Server includes support for creating indices and adding documents to them. We use these features in BlackLab Frontend to allow users to quickly index data and search it, without having to set up a BlackLab installation themselves. Here's a very quick overview.

Currently, only private indices can be created and appended to. This means there must be a logged-in user. The setting `authSystem` in `blacklab-server.yaml` (or `.json`) will let you specify what authentication system you'd like to use. If you specify class `AuthDebugFixed` and a `userId`, you will always be logged in as this user. Note that this debug authentication method only works if you are a debug client (i.e. your IP address is listed in the `debug.addresses` setting, see [Configuration files](configuration.md)). Have a look at the other `Auth*` classes (mostly `AuthHttpBasic` and `AuthRequestAttribute`) to see how real authentication would work.
Currently, only private indices can be created and appended to. This means there must be a logged-in user. The `authentication` section in `blacklab-server.yaml` will let you specify what authentication system you'd like to use. If you specify class `AuthDebugFixed` and a `userId`, you will always be logged in as this user. Note that this debug authentication method only works if you are a debug client (i.e. your IP address is listed in the `debug.addresses` setting, see [Configuration files](configuration.md)). Have a look at the other `Auth*` classes (mostly `AuthHttpBasic` and `AuthRequestAttribute`) to see how real authentication would work.

Another required setting is `userIndexes` (in addition to `indexLocations` which points to the "globally available" indices). In this directory, user-private indices will be created. Obviously, the application needs write permissions on this directory.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public AuthRequestAttribute(Map<String, Object> parameters) {
if (type == null) type = parameters.get("type");
if (type == null) type = "attribute";
if (parName == null) {
logger.error("authSystem.attributeName parameter missing in blacklab-server.json");
logger.error("AuthRequestAttribute: attributeName parameter missing in blacklab-server.json");
return;
}

Expand All @@ -51,7 +51,7 @@ public User determineCurrentUser(UserRequest request) {
if (attributeName == null) {
// (not configured correctly)
logger.warn(
"Cannot determine current user; missing authSystem.attributeName parameter in blacklab-server.json");
"AuthRequestAttribute: cannot determine current user; missing attributeName parameter in blacklab-server.json");
return User.anonymous(sessionId);
}

Expand Down

0 comments on commit 7fdc368

Please sign in to comment.