Skip to content

Implement basic directives via HTTP headers and/or cookies #2506

Closed
@daumling

Description

@daumling

I've implemented a simple auth mechanism using nginx's auth feature. This works just nicely. What I'd like to have is a way to supply basic features to code-server via HTTP headers or cookies.

When a user logs in, the login script could, for example, set a HTTP header with a code-server directive to emulate a chroot for the given user, like e.g.

X-Codeserver-Root: /home/username

This would tell code-server to use the given folder as root folder for this session. This would be a great sandboxing feature for multiple users.

Other HTTP headers would include:

X-Codeserver-Workspace: ...path name ....
X-Codeserver-Folder: ...path name...
X-Codeserver-File: ...path name...

In my case, several users contribute to markdown documentation that is hosted on Github. This solution would allow each use to have his/her own copy of the Github repo, making it safe for concurrent editing.

I am sure that there may be other ideas or use cases for code-server control through HTTP headers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions