43 Commits

Author SHA1 Message Date
Karan Saraswat
8b81b19c3d feat: [PIPE-23710]: changed signature of RepoIdentifier to start taking session argument (#3345) (#3425)
* feat: [PIPE-23710]: changed signature of RepoIdentifier to start taking session argument (#3345)

* argument changed to session
* fixed failing go lint check
*

updated method usage
*

corrected spelling mistake
*

feat: [PIPE-23710]: changed signature of RepoIdentifier to start taking internal boolean argument
2025-02-13 10:14:20 +00:00
Karan Saraswat
5018aacfb7 feat: [PIPE-24894]: Revert "changed signature of RepoIdentifier to start taking session argument (#3345)" (#3424)
* Revert "feat: [PIPE-23710]: changed signature of RepoIdentifier to start taking session argument (#3345)"

This reverts commit a5f510c4b2013e45336ce5aae281d68acebf836d.
2025-02-13 09:21:16 +00:00
Karan Saraswat
a5f510c4b2 feat: [PIPE-23710]: changed signature of RepoIdentifier to start taking session argument (#3345)
* argument changed to session
* fixed failing go lint check
*

updated method usage
*

corrected spelling mistake
*

feat: [PIPE-23710]: changed signature of RepoIdentifier to start taking internal boolean argument
2025-02-04 09:18:16 +00:00
Johannes Batzill
2f54f4003a fix: [CODE-2710]: block numeric identifier for root spaces (#2952) 2024-11-07 21:59:16 +00:00
Andreas Deininger
ff2da8563e [GH] Fix typos (#3566)
This PR fixes various typos i spotted in the project.
2024-11-07 11:34:07 -08:00
Johannes Batzill
9b89229a35 fix: [CODE-2684]: Move go-get to git URL and support submodules and major versioning (#2914) 2024-11-05 17:13:26 +00:00
Atefeh Mohseni Ejiyeh
c365ef246a Support Public Access (#2021) 2024-05-23 04:56:26 +00:00
Abhinav Singh
16ef31bcb6 feat: support diff repo id check in harness code (#1123) 2024-03-21 00:38:18 +00:00
Johannes Batzill
adf2046a94 [MISC] Move UID to Identifier to match Harness Standards (#992) 2024-01-29 23:29:53 +00:00
Johannes Batzill
53555544a2 [Webhook] Add UID field (#936) 2023-12-29 16:39:45 +00:00
Johannes Batzill
a83cd21c17 [OPEN-SOURCE] Prepare Repository (#605) 2023-09-24 07:33:16 +00:00
Johannes Batzill
8cd3e5d015 [Standalone] Add temporary JWT for pipeline executions (#480) 2023-09-14 08:54:03 +00:00
Johannes Batzill
c8ce82d197 [Standalone] Make Token Expiration Optional & Fix CLI Register + Login (#239) 2023-07-26 01:03:03 +00:00
Johannes Batzill
bf9906c4ce [API] Add principals API, move users to admin, simplify user/service/serviceaccount validation (#300) 2023-02-03 00:15:11 -08:00
Johannes Batzill
335998505e [MISC] Introduce PathStore and Move PathLogic to Controller Layer (#226)
This change is a follow up on the effort to remove transactions and sync stores from the database layer, and move them in the application layer. It is addressing the repo + space store.
The following changes are included:
- Introduce PathStore storing resource paths (repo + space)
- Add foreign key from path.repo_id/space_id to repo.id/space.id
- Add foreign key from repo/space.parent_id to space.id
- Remove repo_sync and space_sync
- Move path creation logic to repo/space controller (for both creating primary paths for new repos/spaces, as well as creating alias spaces)
- Reimplement repo/space moving on controller layer
2023-01-18 11:34:12 -08:00
Johannes Batzill
a74d779dc4 [Webhook] Add display_name/description/latest_execution_result to webhook (#180)
This PR adds the following fields to webhooks:
- 'DisplayName' - the display name of the webhook for easier recognition in UI (no uniqueness guarantees)
- 'Description' - an (optional) description of the webhook
 - 'LatestExecutionResult' - contains the result of the latest execution of the webhook
2023-01-11 17:11:10 -08:00
Johannes Batzill
a426cdd69b [GIT] Add Support for Other Git Clients (#171) 2023-01-10 14:35:09 -08:00
Johannes Batzill
44ec7ceb07 [Webhook] Add API and DB Basics (#142)
This change introduces:
- webhook type / store / controller / handler
- webhookExecution type / store / controller / handler
- foreign key fix for sqlite3
2022-12-28 13:07:48 -08:00
Enver Bisevac
630c9b553f ordering imports linter and writer (#85) 2022-11-22 23:42:39 +01:00
Johannes Batzill
c55c53deab [API] Add Create + Delete Branch API (+ Basic GIT Error Propagation) (#70)
This change adds the following:
- create / delete branch
- basic error propagation from git to user (notfound, conflict, invalidinput)
- create repo root folder in server instead of service constructor
2022-11-10 20:57:31 -08:00
Johannes Batzill
8fe80ab811 Remove Identifier from UI - Replace with original Name (#59)
* remove identifier from UI and replace it with original 'Name'
* extend uid to length 100
* allow repo name of length 1
2022-11-07 14:37:50 -08:00
Johannes Batzill
3ba0f75c8d Introduce UIDs for Space / Repo / Tokens, Add Custom Harness Validation, ... (#57)
This change adds the following:
- Space UID + Custom harness validation (accountId for top level space, harness identifier for child spaces)
- Repo UID + Custom harness validation (harness identifier)
- Store Unique casing of space / repo path and add Path.ValueUnique (with Unique index) to allow for application layer controlling the case sensitivity (case insensitive standalone vs partially case sensitive harness)
- Token UID (unique index over ownertype + ownerID + tokenUID)
- Add DisplayName for principals (replaces Name to avoid confustion)
- Store Unique casing of principal UID and add Principal.ValueUnique (with unique index) to allow for application layer, per principal type control of case sensitivity (required in embedded mode)
- Generate serviceAccount UID (+Email) Randomly (sa-{space|repo}-{ID}-{random}) - Allows to have a unique UID across all principals while reducing likelyhood of overlaps with users + avoid overlap across spaces / repos.
- Sync casing of space names (accountId orgId projectId) when creating spaces on the fly (to ensure case sensitivity of - harness code) or use the existing space to update casing.
- Update serviceaccount client to match updated NG Manager API
- in embedded mode create spaces for harness resources owning the service account
2022-11-06 23:14:47 -08:00
Johannes Batzill
2d897c4486 [MAINT] Add PAT CLI command and update readme (#45)
Add PAT CLI command and update readme
2022-10-24 22:50:33 -07:00
Johannes Batzill
743aee6029 [API] Add List Branches, Improve latestCommit Performance for listing directory (#38)
This commit has the following changes:
- API for listing branches
- Improve performance of content API for dir type responses with includeCommit=true
- swagger for git operations
- fix file names from camelCase to kebab_case
2022-10-17 23:05:50 -07:00
Johannes Batzill
91a75ed601 Add GetContent and ListCommits APIs, Fix DefaultBranch support (#32)
Adds the following:
- Add GetContent API (with gitrpc, proto, gitadapter changes)
- Add ListCommits API (with gitrpc, proto, gitadapter changes)
- DefaultBranch (to repo table in DB, update branch in git-repo, have default value in config)
2022-10-17 00:14:31 -07:00
Enver Bisevac
00647d7d1b [MAINT] golangci-lint config changed (#31)
* goheader linter added

* file header consistency
2022-10-13 14:39:15 +02:00
Johannes Batzill
5786ad2409 [Embedded] Harness Router, Inline Space Creation, Bootstrap, Harness/Admin User Setup (#28)
Adds the basic for harness embedded mode:
- Harness dedicated router with custom APIHandler
- Inline Space Creation
- Client for Account/Org/Project
- Bootstrap (Allows for automated creation of admin user and gitness service (used for all platform required ops))
- Inline harness service principal creation
- Ignore flag for ACL.
2022-10-10 21:32:14 -07:00
Johannes Batzill
fad6e18898 Introduce Controller for Repo, Space, User, and ServiceAccount (#25)
Preparing the support for harness specific API router + http handler, which allows us to have complete control over the rest api naming and functionality, without having to do complex path rewrites or request / reponse rewrites inline.
2022-10-03 18:56:49 -07:00
Johannes Batzill
4668e94027 [Harness] Adding JWT/PAT/SAT Support, Harness Clients, Inline User/ServiceAccount Creation, harness Build flag, ... (#22)
This change adds the initial stepping stones for harness integration:
- Authentication: JWT/PAT/SAT support
- Authorization: ACL integration (acl currently denies requests as gitness hasn't been integrated yet)
- Remote Clients for Token, User, ServiceAccount, ACL
- User Integration: Syncs harness users during authentication if unknown
- SA integration: syncs harness service accounts during authentication if unknown
- Initial harness API: THIS WILL BE CHANGED IN THE FUTURE!
- single harness subpackage (all marked with harness build flag)
- harness & standalone wire + make build commands
2022-09-30 16:22:12 -07:00
Johannes Batzill
8c2f900c80 Principals, ServiceAccounts, Tokens and auth.Sessions (#15)
This change introduces the concept of a principal (abstraction of call identity), and adds a new service account type principal. Also adds support for different tokens (session, PAT, SAT, OAuth2) and adds auth.Session which is being used to capture information about the caller and call method.
2022-09-25 23:44:51 -07:00
Enver Bisevac
f03528e862 [MAINT] initial config for ci linter (#17)
* initial config for ci linter

* more linter work

* linter errors fix

* linter errors fix

* linter conf minor changes
2022-09-19 18:13:18 +02:00
Enver Bisevac
ca8aa47e05 [MAINT] initial work on linter setup (#16)
* initial work on linter setup

* simple linter rules fixed
2022-09-13 00:08:43 +02:00
Johannes Batzill
b7b9f53b0d Improve error handling to match go standards - don't wrap and rethrow, but log and return. Also adds some more validations for path creation and resource moving. Add accesslogging for git and api router (#14)
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
2022-09-09 22:08:46 -07:00
Johannes Batzill
4812beedc6 Enforce max path length on store layer to avoid racing condition, (#12)
Add enforcement of the path length to the store layer before writing the path, move errs to internal, and adds a comms package under internal/api.
2022-09-09 00:45:41 -07:00
Johannes Batzill
1115a5083b Add Paths support and error improvements (#11)
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
2022-09-08 21:39:15 -07:00
Johannes Batzill
1db4fc9c8d Change create API for space/repo to follow REST best practices (#10)
Move repo and space create apis to /api/v1/repos/ and /api/v1/spaces/ and take name and parentId in body.
2022-09-06 20:36:34 -07:00
Johannes Batzill
ff806fb492 block 'api' as root space name, minor improvements 2022-09-05 18:45:16 -07:00
Johannes Batzill
d7f0ae4b2c Add base structure for rest api, git api, web api. Add base authn and authz, as well as spaces and repository apis 2022-09-05 13:47:00 -07:00
Johannes Batzill
32e6c4929f Add authn, authz, spaces, guard, terminated FQNs 2022-09-05 13:47:00 -07:00
Johannes Batzill
4cd1ecebf1 Remove unnecessary types 2022-09-05 13:47:00 -07:00
Johannes Batzill
4aa8819765 Rename project to 'gitness' 2022-08-29 10:12:07 -07:00
Johannes Batzill
813d343f6a Rename module to github.com/harness/scm. Fix web/dist.go 2022-08-18 15:15:50 -07:00
Tan Nhu
5891818ce1 Initial commit 2022-08-09 12:37:37 -07:00