Menu

#2167 Document Sandstorm API

Sandstorm
open
nobody
2020-05-19
2019-02-05
Anonymous
No

Originally created by: xet7

Now that Sandstorm REST API [#1279] works for exporting Wekan board as documented here:
https://github.com/wekan/wekan/wiki/Wekan-Sandstorm-cards-to-CSV-using-Python
I need to test also other REST API functionality at what URL they do work, are they same as at Standalone Wekan, or for example at /api/sandstorm/ or some other special url that Wekan Sandstorm version uses. If there is some error in using API, I need to add similar code that also made export API work at [#1279] . Then I need to add more examples to:
https://github.com/wekan/wekan/wiki/Wekan-Sandstorm-cards-to-CSV-using-Python

If someone tries Sandstorm Wekan API and gets some error message, please add that error message as comment to this issue. Thanks!

Discussion

  • Anonymous

    Anonymous - 2019-02-05

    Originally posted by: ertanalytics

    Receive bad request for user addition on Sandstorm Wekan 2.16.0~2019-02-03

    `import requests
    import json

    https://api-ec9e7c51610a73ebf1e11001caf8b1dd.oasis.sandstorm.io#L92rf5G3B3rIsk8Z1USnnM-6ZjbRFugyWZWCaxP4iDt

    APIBegURL = 'https://Bearer:nS_0nDcc63vZ9QWpuNCkPK5BBMGLDiLxP-0JNhVKz79@api-a5587d9539ca906a2aa5e1eebc7dac89.oasis.sandstorm.io'

    APIBegURL = 'https://Bearer:L92rf5G3B3rIsk8Z1USnnM-6ZjbRFugyWZWCaxP4iDt@api-ec9e7c51610a73ebf1e11001caf8b1dd.oasis.sandstorm.io'
    EndURL = '#L92rf5G3B3rIsk8Z1USnnM-6ZjbRFugyWZWCaxP4iDt'

    Commands

    Bad Request Result for User Addition

    usersCommand = '/api/boards/sandstorm/users?authToken='
    APIRequest = APIBegURL + usersCommand + EndURL
    response = requests.post(APIRequest,
    data='',
    json='{ "username": "tester", "password": "tester", "email": "tester@example.com", "fromAdmin": "true" }'
    )
    print(response.text) ## Returns bad request`

     
  • Anonymous

    Anonymous - 2019-02-05

    Originally posted by: xet7

    I guess this is because at Sandstorm Wekan does not use username/password, because Sandstorm provides SSO to all apps and in Wekan is only Sandstorm user ID. User collection/table structure is different in Standalone vs Sandstorm Wekan. This can be seen when exporting Sandstorm grain .zip to json files.

    I'll look is there any way to admin users using Sandstorm API in general.

     
  • Anonymous

    Anonymous - 2020-05-19

    Originally posted by: zenhack

    Indeed, it doesn't make a lot of sense to use wekan APIs for creating
    users in the Sandstorm version, as it doesn't manage that functionality
    in the first place.

    Unfortunately there's not currently any official programmatic API for
    sandstorm meant to be used from outside the system. There was some
    discussion of adding something like that here:

    https://github.com/sandstorm-io/sandstorm/issues/2586
    

    ...and I'd still like to see it, but it hasn't happened yet.

    You could also theoretically use the meteor methods via the DDP socket
    directly, but that's not a stable interface and it's not really
    documented.

    Also worth noting that Sandstorm doesn't really have anything it would
    make sense to map a generic "create user" call to, as Sandstorm shells
    out to other services for account management for the most part.

    -Ian

     
  • Anonymous

    Anonymous - 2020-05-19

    Originally posted by: xet7

    @zenhack

    How could user management at [#2405] be fixed so it works?

     
  • Anonymous

    Anonymous - 2020-05-19

    Originally posted by: zenhack

    What does "fixed" mean there exactly? What is the desired behavior? Is there a strong use case for multiple boards in a single grain that isn't covered by just creating more grains?

    If not, it seems like the natural thing to do here would be to just hide the bits of the UI for functionality that doesn't make sense inside of sandstorm, so that users stop getting confused by them. Also probably document that the corresponding API operations aren't supported in the Sandstorm version.

    If so, it would be useful to know what the use case is.

     
  • Anonymous

    Anonymous - 2020-05-19

    Originally posted by: ocdtrekkie

    @zenhack So the biggest reason Wekan stopped presenting a single-board interface in Sandstorm is things like backup and restore functionality using additional boards. There were places you could end up where the only board Sandstorm would display was not showing all the information in the grain.

    Right now I believe the integration login basically makes sure a Sandstorm user has appropriate permissions to the default board, but ideally, Sandstorm should probably be making sure the Sandstorm user has appropriate permissions to all boards in the Wekan grain, such that all boards in a given grain share the same security levels for a given user. (Sandstorm's security model would generally indeed suggest that you create different grains if you want to assign different permissions to different boards.)

     
  • Anonymous

    Anonymous - 2020-05-19

    Originally posted by: zenhack

    Ok, yeah, in that case I would say tweak the logic so that all boards use the permissions reported by sandstorm, and hide the irrelevant bits of the UI (like user management features).

     
  • Anonymous

    Anonymous - 2020-05-19

    Originally posted by: xet7

    Sandstorm should probably be making sure the Sandstorm user has appropriate permissions to all boards in the Wekan grain, such that all boards in a given grain share the same security levels for a given user. (Sandstorm's security model would generally indeed suggest that you create different grains if you want to assign different permissions to different boards.)

    At Wekan v2.28 was All Boards page made visible, so fix "Board not found" and enable more Standalone features in Wekan.

    At Wekan v2.90 I did revert changing every Sandstorm Wekan board as Admin (or BoardAdmin). I would think only Admin/BoardAdmin can export boards, so it does not work for some old grains. Admin/BoardAdmin can add new users.

    There is upcoming Teams/Organizations features. Would it be possible to setup these organization structures inside Wekan grain?

    If user management features inside Wekan grain would be hidden, then it would not be able to change user details, like full name, title, initials, etc. There can be that kind of details that would be useful to be able to be edited.

    There was also some issue about sending emails for notifications from Wekan grain. Would those go through Sandstorm email?

    Wekan also has Notification drawer like Trello, where each user can also mark notifications as read. Would those notifications go to Sandstorm notifications? Or still be inside Wekan?

    There are also some layout options at Admin Panel.

    Some discussion also has been sometime, that can Wekan Rules be used to set run with Sandstorm cron, and have integrations between Sandstorm grains.

    In future, could there be Wekan Rules rule that calls some REST API that is outside of Sandstorm?

    What are current plans for Sandstorm-internal APIs and for access to outside of grains?

     
  • Anonymous

    Anonymous - 2020-05-19

    Originally posted by: ocdtrekkie

    @xet7 The short answer is that all of those things are possible, and the Sandstorm APIs already exist for Cron, Notifications, APIs, etc. but I am not sure how much work it is to integrate each with Wekan, and how much of the work the existing integration code already covers.

     
  • Anonymous

    Anonymous - 2020-05-19

    Originally posted by: xet7

    From @zenhack

    Ok, yeah, in that case I would say tweak the logic so that all boards use the permissions reported by sandstorm, and hide the irrelevant bits of the UI (like user management features).

    Having those Sandstorm user permissions affect all boards of of grain would already help a lot. I'll try to look where that code is.

     
  • Anonymous

    Anonymous - 2020-05-19

    Originally posted by: zenhack

    If user management features inside Wekan grain would be hidden, then it would not be able to change user details, like full name, title, initials, etc. There can be that kind of details that would be useful to be able to be edited.

    Probably you should just be pulling this information from Sandstorm, which provides much of it via headers (and iirc meteor-accounts-sandstorm pulls it out for you). This way the user doesn't have to change it in multiple places.

     

Log in to post a comment.