Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Cannot get list of users and create/update user #965

Closed
orlovm opened this issue Nov 9, 2021 · 4 comments
Closed

API Cannot get list of users and create/update user #965

orlovm opened this issue Nov 9, 2021 · 4 comments
Assignees
Labels

Comments

@orlovm
Copy link
Member

orlovm commented Nov 9, 2021

I'm running artipie inside Docker, with a command:
docker run --rm -v /etc/artipie:/etc/artipie -v /var/artipie:/var/artipie --name artipie -p 8080:8080 artipie/artipie:latest

Most API calls works as intended.
But there is a problem with users.
I can only get or delete existing user.

If I try to get list of users with:
curl -u artipie:artipie -v http://localhost:8080/api/security/users
It responds with 403 status code.

And artipie crashes when I try to use PUT or POST method e.g.:
curl -u artipie:artipie -X 'PUT' -d '{"password":"plain:test","email":"test@test.com"}' http://localhost:8080/api/security/users/test
Output of artipie is attached.

artipie.txt

@olenagerasimova
Copy link
Member

@orlovm hi,

  1. there is a separate file with permissions to access Artipie api, it's yaml config called _permissions.yaml, check the example here. Is the file present in your configuration? As for corresponding documentation, I do not see any, guess we have to add it later
  2. there is no need to pass password type, it's plain by default, please, try {"password":"test","email":"test@test.com"}

@orlovm
Copy link
Member Author

orlovm commented Nov 11, 2021

@olenagerasimova hi!

  1. Yes, I've copied config files from example dir of artipie. I have an artipie.yaml file located inside /etc/artipie and all other config files inside /var/artipie/repo.
  2. I have the same result with different variations of JSON data and PUT or POST requests to api/security/users/{username}.

g4s8 pushed a commit to artipie/management-api that referenced this issue Nov 15, 2021
Part of artipie/artipie#965
Added rq line to get users in FromRqLine, corresponding test and updated http and asto.
g4s8 added a commit that referenced this issue Nov 23, 2021
Updated management-api, asto, http and added IT for /api/security/users endpoint.
Also, due to NoSuchMethod runtime exception with hamcrest Matchers.allOff method in one of the tests, added hamcrest dependency.

Ticket: #965
g4s8 added a commit to artipie/management-api that referenced this issue Dec 22, 2021
* Add absent repos

* cicd(release): added release config for #38

* Fixed parameters and storage settings format in `ApiRepoUpdateSlice`

Closes #39 - fixed 2 problems in ApiRepoUpdateSlice:
 1) parameters separator was expected to be ; instead of &
 2) storage settings were always expected to be yaml, but there also can be string for default value

PR: #40

* Repo config should be url decoded

Closes #39 - Body with repo configs should be url-decoded.

PR: #41

* Improved updating storage settings functionality (#43)

Closes #42 - simplified and fixed updating storage scenario in ApiRepoUpdateSlice.

On dashboard we always work with whole yaml repo settings, so there is no need to update section by section, we can simply rewrite the whole file after checking that required fields (type and storage) are present in the new version.

* fix: added repository configuration descriptions

Added description for several repositories.

Issue: artipie/artipie#317
PR: #44

* fix: handle errors in `ApiRepoUpdateSlice` (#45)

Handle errors in `ApiRepoUpdateSlice` (#45)

Closes: artipie/artipie#320

* feat(conda): added conda repository to dashboard (#46)

Added anaconda repository option to dashboard and configuration description.

Ticket: artipie/artipie#317

* doc: verbose link name

Clarified API reference link name.

Closes: #47

* fix: add rq line to get users in `FromRqLine` (#48)

Part of artipie/artipie#965
Added rq line to get users in FromRqLine, corresponding test and updated http and asto.

* feat: added slice for repo delete (#49)

Add slice to delete a repo. Added disabled test for this slice as it is necessary to implement delete operation in FakeConfigFile class.

Ticket: artipie/artipie#321

* feat: add slice for routing `POST` requests (#51)

Added slice ApiRepoPostRtSlice for routing post requests by parsing body content. This class will be used in artipie module. Test will be added in next PR.

Ticket: artipie/artipie#321

* deps: bumped ppom and other deps (#53)

 * Bumped ppom from 0.5.1 to 1.1.0
 * Bumped asto from v1.9.0 to v1.10.0
 * Bumped http-client from 0.3.2 to 0.3.6
 * Bumped vert-server from 0.4 to 0.5

* refactor: extract class for body parsing (#52)

Extract class for parsing body content for receiving some content.

Close: #50

* test: enable test for delete and add for postRt (#55)

Enable and a bit extend test for ApiRepoDeleteSlice and add test for ApiRepoPostRtSlice.

Ref: artipie/artipie#321

* refactor: use storages instead of settings storage

Co-authored-by: Kirill <g4s8.public@gmail.com>
Co-authored-by: Alena <olena.gerasimova@gmail.com>
g4s8 added a commit to artipie/management-api that referenced this issue Dec 27, 2021
* Add absent repos

* cicd(release): added release config for #38

* Fixed parameters and storage settings format in `ApiRepoUpdateSlice`

Closes #39 - fixed 2 problems in ApiRepoUpdateSlice:
 1) parameters separator was expected to be ; instead of &
 2) storage settings were always expected to be yaml, but there also can be string for default value

PR: #40

* Repo config should be url decoded

Closes #39 - Body with repo configs should be url-decoded.

PR: #41

* Improved updating storage settings functionality (#43)

Closes #42 - simplified and fixed updating storage scenario in ApiRepoUpdateSlice.

On dashboard we always work with whole yaml repo settings, so there is no need to update section by section, we can simply rewrite the whole file after checking that required fields (type and storage) are present in the new version.

* fix: added repository configuration descriptions

Added description for several repositories.

Issue: artipie/artipie#317
PR: #44

* fix: handle errors in `ApiRepoUpdateSlice` (#45)

Handle errors in `ApiRepoUpdateSlice` (#45)

Closes: artipie/artipie#320

* feat(conda): added conda repository to dashboard (#46)

Added anaconda repository option to dashboard and configuration description.

Ticket: artipie/artipie#317

* doc: verbose link name

Clarified API reference link name.

Closes: #47

* fix: add rq line to get users in `FromRqLine` (#48)

Part of artipie/artipie#965
Added rq line to get users in FromRqLine, corresponding test and updated http and asto.

* feat: added slice for repo delete (#49)

Add slice to delete a repo. Added disabled test for this slice as it is necessary to implement delete operation in FakeConfigFile class.

Ticket: artipie/artipie#321

* feat: add slice for routing `POST` requests (#51)

Added slice ApiRepoPostRtSlice for routing post requests by parsing body content. This class will be used in artipie module. Test will be added in next PR.

Ticket: artipie/artipie#321

* deps: bumped ppom and other deps (#53)

 * Bumped ppom from 0.5.1 to 1.1.0
 * Bumped asto from v1.9.0 to v1.10.0
 * Bumped http-client from 0.3.2 to 0.3.6
 * Bumped vert-server from 0.4 to 0.5

* refactor: extract class for body parsing (#52)

Extract class for parsing body content for receiving some content.

Close: #50

* test: enable test for delete and add for postRt (#55)

Enable and a bit extend test for ApiRepoDeleteSlice and add test for ApiRepoPostRtSlice.

Ref: artipie/artipie#321

* fix: delete from items from substorage

Co-authored-by: Kirill <g4s8.public@gmail.com>
Co-authored-by: Alena <olena.gerasimova@gmail.com>
@github-actions
Copy link

Issue is stale, CC: @g4s8

@olenagerasimova
Copy link
Member

This API not valid anymore, see https://github.com/artipie/front

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants