This commit contains the following:
- Improve and simplify error handling (remove unnecessary wrappers, make it feel like go)
- Add extra validation for path creation and resource moving (path has to be within same top space, no top space alias allowed)
- Add access logging for rest api and git api
This change is adding the concept of Paths.
A repository and space always have a Primary Path which always is represents the ancestry to the root space.
All access history / resource visibility / child listings / UI traversal / etc. is done via that path.
Additionally, repos and spaces can have Alias Paths, which as the name states are aliases. via the primary path.
They sole impact is that a space or repo can be reached via different paths from the UI / rest apis / git apis.
This fulfills two major purposes:
- Customers can rename or move projects and spaces without breaking any existing references from CI pipeliens / code bases / local repos / ...
- Customer can create shorter aliases for important repos when in harness embeded mode! (acc/org/proj/repo can be shortened to acc/repo, or acc/repo'
Apart from the path changes, this PR adds:
Improved User facing errors
Improved internal error handling and wrapping
update / rename operation for repo and space
path list / delete / create operation for repo and space
This PR removes some unnecessary files inherited from the sample-repo,
and adds the frame for the following:
Rest Server (terminated FQN encoding, high level routing, basic API/GIT/UI routes, repo/space/user injection into request)
Spaces (Struct, DB, CRUD Operations)
Repos (Struct, DB, CRUD Operatons)
guard middleware for simplifying authorization
Authentication (Abstraction, frame for harness integration)
Authorization (Abstraction, harness ACL based implementation)
This change is renaming the go module to github.com/harness/scm to match the github url of the repository.
Furthermore, it adds back the code in web/dist.go that is serving the static web content, as otherwise builds are failing.