Comments (1)
I think we would need an endpoint that would allow us to create users for the above task in Engage. We could hackily add data to Engage and users.txt by hand but having an endpoint will let us automate the entire process.
Approach:
Authentication
Since this endpoint will create new users, this needs to have authentication. We don't have to implement our own, and we can use HubAuth
to use the same authentication as the jupyterhub server. We can create a jupyterhub token as an admin user from the UI and set that as configuration in Engage. Once done, we only need to check whether the user making the request is an admin or not.
API
Create user
Successful request:
POST /services/dashboard/users
{
"username": "alice",
"password": "alice42"
}
---
201 CREATED
{
"username": "alice"
}
Failed request:
POST /services/dashboard/users
{
"username": "alice",
"password": "hello:world"
}
---
400 BAD REQUEST
Content-Type: application/json
{
"message": "Password is invalid"
}
Other error messages:
Username is invalid
Invalid request body
Implementation
Dashboard service should:
- Validate the username/password strings - all characters should be in
[ascii_letters + digits]
only. (because punctuation/whitespace might not work well with the format of users.txt) - Write
username:password\n
to users.txt - Run
add-users.py
script (stored at/opt/jhub/add-users.py
) - Return response
from pipalhub.
Related Issues (12)
- Export notebooks on save event to avoid polling HOT 8
- Auto login link HOT 1
- Streamline setting up a new instance HOT 1
- Admin interface
- Dashboard service: with mechanism for notification of new saves HOT 6
- Generate summary page when a notebook is saved
- Dashboard notifications: browser javascript to poll and check for updates on the page HOT 1
- Add documentation for newly added components
- Set shell to bash when adding users HOT 2
- nbconvert fails to make html for live notes sharing
- Need some notification for comments
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pipalhub.