KorAP / Kustvakt

:speedboat: User and policy management component for KorAP, capable of rewriting queries for policy based document restrictions.
BSD 2-Clause "Simplified" License
4 stars 3 forks source link

Wrong value in API #568

Closed notesjor closed 1 year ago

notesjor commented 1 year ago

I tried this: https://github.com/KorAP/Kustvakt/wiki/Service:-Virtual-Corpus-Creation

Example:

curl --request PUT "https://korap.ids-mannheim.de/api/v1.0/vc/~owid/test" --header "Authorization: Bearer XXX" --header "Content-Type: application/json" --data "{\"type\": \"PRIVATE\", \"corpusQuery\": \"corpusSigle=GOE & creationDate since 1820\"}"

Please replace the following information

Get this error: { "errors": [ [ 2010, "Unauthorized operation for user: MAIL", "MAIL" ] ] }

Problem: MAIL is the e-mail of user owid (I have replaced this info here with MAIL). I would expect the username here, not the email address. That's creepy. The problem: I need to specify the email for both creating and retrieving sub-corpus information.

As mentioned in https://github.com/KorAP/Kustvakt/issues/566, I do not have access to this info.

I see two solutions here:

  1. use the user name here instead of e-mail.
  2. more complicated - and ugly, with OAuth2, developers don't want to see any detailed information such as e-mail. modify the VC documentation (MAIL instead of username) and then send username and MAIL - see https://github.com/KorAP/Kustvakt/issues/566
margaretha commented 1 year ago

Thanks for reporting the bug. That is really bad. The virtual corpus services have not been integrated in the Web-UI thus not tested very often. It used to show only username. This must have been caused by the synchronization of username and emails.

margaretha commented 1 year ago

We have switched to using usernames instead of emails in aa87e202a2507716393c4386492b6464953a130f and d5fb949b331b5ea26e93b224b0d3d346a9574bab.