Skip to content

feat: add GitHub storage backend support - #66

Open
pierre-monnet wants to merge 5 commits into
datacontract:mainfrom
pierre-monnet:github
Open

feat: add GitHub storage backend support#66
pierre-monnet wants to merge 5 commits into
datacontract:mainfrom
pierre-monnet:github

Conversation

@pierre-monnet

Copy link
Copy Markdown

This pull request introduces a new "GITHUB" mode to the editor, allowing it to load and save data contract files directly from a GitHub repository. It adds support for configuring GitHub repository details, integrates a secure proxy option to avoid exposing tokens to the browser, and updates both the documentation and the application logic to support these features.

The most important changes are:

GITHUB Mode Support:

  • Added a new GITHUB mode to the editor, enabling direct integration with a GitHub repository for loading and saving a single data contract file. The editor can now be configured to auto-load a file from a specified repo and branch, or let the user pick the repo/branch/path at runtime. (CONFIGURATION.md, src/App.jsx) [1] [2] [3]

GitHub Configuration Options:

  • Introduced new environment variables and configuration options (GITHUB_OWNER, GITHUB_REPO, GITHUB_BRANCH, GITHUB_PATH, GITHUB_TOKEN, GITHUB_API_BASE_URL, GITHUB_PROXY_URL) to support GitHub integration, and updated the Dockerfile to inject these into config.json. (CONFIGURATION.md, Dockerfile) [1] [2]

Proxy Support for Secure Token Handling:

  • Added documentation (GITHUB_PROXY.md) and a reference implementation (github-proxy.js) for an optional server-side proxy that handles all GitHub API requests, keeping the GitHub token out of the browser for improved security in production/multi-user setups. (GITHUB_PROXY.md, github-proxy.js) [1] [2]

Documentation Updates:

  • Expanded CONFIGURATION.md with detailed instructions and code samples for configuring and using the new GITHUB mode, including both direct and proxied setups. (CONFIGURATION.md) [1] [2]

App Logic Enhancements:

  • Updated the main app logic to automatically load the configured GitHub file on mount in GITHUB mode, and to handle error notifications gracefully if the file cannot be loaded. (src/App.jsx)

@pierre-monnet

Copy link
Copy Markdown
Author

@jochenchrist @simonharrer this PR is ready for review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant