Giter Club home page Giter Club logo

bashlib's Introduction

Bashlib

This repository contains a suite of functionality to facilitate use and development for Solid, mainly focused on supporting the Community Solid Server. The Bashlib-css library provides functionality for pod-creation and authentication options that are mostly restricted in compatilibty with the Community Solid Server. The Bashlib-solid library provides functionality to interact with Solid environments from Node.JS and the CLI, providing shell-like functionality to facilitate the use of and development for Solid for people without knowledge of Solid or Linked Data Platform (LDP).

Setup

To setup all the libraries, please run the setup script.

git clone [email protected]:SolidLabResearch/Bashlib.git
cd Bashlib
bash setup.sh

Tutorial

A tutorial for the CLI interface for Bashlib can be found here.


Bashlib-css provides a set of modules created for development and testing using the Community Solid Server. It enables quick setting up of new Solid accounts and pods and authenticating users in Node.JS or the CLI.

Compatibility: CSSv2.0.0 - current The create-pod module handles the creation of new data pods on a Community Solid Server instance. It automates the process of creating a Solid-account and accompanying data pod for new users, and can be used from Node.JS or the CLI.

Compatibility: CSSv4.0.0 - current The create-token module handles the creation of Client Credentials tokens, a CSS-specific authentication mechanism that does not require browser interaction. The resulting tokens are stored on the file system, and can be used to automatically authenticate users in Node.JS and on the CLI.

This module handles the building of an authenticated fetch function for Node.JS. It provides multiple options to authenticate the user.

compatibility: all versions of all pods The interactive login option authenticates the user via an interactive prompt in the browser. This follows the default Inrupt Node.JS authentication flow. The active session information is stored, resulting in subsequent runs of the application re-using previous sessions where possible.

compatibility: CSSv4.0.0 - current The Client Credentials Token generated by the create-token module is used to automatically authenticate the user in Node.JS without any browser interaction. The active session information is stored, resulting in subsequent runs of the application re-using previous sessions where possible.

compatibility: CSSv2.x.x - deprecated This authentication option makes use of user credentials being passed to authenticate the user. For this, it hijacks the browser flow for this specific CSS version. Using a Client Credentials token authentication flow with a more up-to-date version of the CSS is advised.


Bashlib-solid provides a set of functions to interact with Solid environments from Node.JS and the CLI, providing shell-like functionality to facilitate the use of and development for Solid for people without knowledge of Solid or LDP. All modules provide their functionality both on the CLI interface, as well as through Node.JS.

CLI-Interface

The CLI-interface exposes all functions as commands on the CLI. It makes use of the Authentication module of Bashlib-css to authenticate the user.

Node.JS Interface

All functions are exposed in Node.JS as exports of the Bashlib-solid library. Authentication can be done using the Authentication module of Bashlib-css, or you can provide a custom authenticated fetch function.

Functions

This is a listing of all the functions made available on the CLI and Node.JS.

The fetch function can be used to fetch authenticated resources from a Solid environment.

The list function can be used to list resources in a container in a Solid environment. It provides additional CLI options include .acl files and more if needed.

The tree function can be used to write a tree-structure of all resources in a container in a Solid environment to the command line. In Node.JS, this function writes the same output to the console, and returns nothing. When listing files in Node.JS, please use the find function.

The copy function provides functionality to copy files to and from both the local filesystem and a Solid environement. Recursive copying of containers is set as a default.

The move function provides functionality to move files to and from both the local filesystem and a Solid environement. Recursive moving of containers is set as a default.

The remove function provides functionality to remove files on a Solid environement. Recursive removing of containers is added with a flag to prevent accidents.

The mkdir function provides functionality to create empty containers in a Solid environment.

The Touch function provides functionality to create empty resources in a Solid environment.

The find function allows you to recursively find resources in a container in a Solid environment matching a given file name regex.

The query function allows you to recursively query resources in a container in a Solid environment using a given SPARQL query.

The perms function provides functionality for the listing and editing of resource permissions in a Solid environment.

The edit function is only available on the CLI interface! It can be used to fetch a remote resource, edit it locally in your editor, and put the result back on the resource location.

Contributors: how to release

This repo uses release-it to manage SemVer version numbers, create GitHub releases and publish to npm.

Run npm run release and follow the intructions on the CLI. Don't forget to create a personal access token and expose it through the GITHUB_TOKEN environment variable, or the github release won't work. For more information, visit the release-it docs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.