-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Harness] Adding JWT/PAT/SAT Support, Harness Clients, Inline User/Se…
…rviceAccount 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
- Loading branch information
1 parent
5baf42d
commit 4668e94
Showing
67 changed files
with
905 additions
and
772 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
GITNESS_TRACE=true | ||
HARNESS_JWT_IDENTITY="gitness" | ||
HARNESS_JWT_SECRET="IC04LYMBf1lDP5oeY4hupxd4HJhLmN6azUku3xEbeE3SUx5G3ZYzhbiwVtK4i7AmqyU9OZkwB4v8E9qM" | ||
HARNESS_JWT_VALIDINMIN=1440 | ||
HARNESS_JWT_BEARER_IDENTITY="Bearer" | ||
HARNESS_JWT_BEARER_SECRET="dOkdsVqdRPPRJG31XU0qY4MPqmBBMk0PTAGIKM6O7TGqhjyxScIdJe80mwh5Yb5zF3KxYBHw6B3Lfzlq" | ||
HARNESS_JWT_IDENTITY_SERVICE_IDENTITY="IdentityService" | ||
HARNESS_JWT_IDENTITY_SERVICE_SECRET="HVSKUYqD4e5Rxu12hFDdCJKGM64sxgEynvdDhaOHaTHhwwn0K4Ttr0uoOxSsEVYNrUU" | ||
HARNESS_JWT_MANAGER_IDENTITY="Manager" | ||
HARNESS_JWT_MANAGER_SECRET="dOkdsVqdRPPRJG31XU0qY4MPqmBBMk0PTAGIKM6O7TGqhjyxScIdJe80mwh5Yb5zF3KxYBHw6B3Lfzlq" | ||
HARNESS_JWT_NGMANAGER_IDENTITY="NextGenManager" | ||
HARNESS_JWT_NGMANAGER_SECRET="IC04LYMBf1lDP5oeY4hupxd4HJhLmN6azUku3xEbeE3SUx5G3ZYzhbiwVtK4i7AmqyU9OZkwB4v8E9qM" | ||
HARNESS_CLIENTS_ACL_SECURE=false | ||
HARNESS_CLIENTS_ACL_BASEURL="https://localhost:9006/api" | ||
HARNESS_CLIENTS_MANAGER_SECURE=false | ||
HARNESS_CLIENTS_MANAGER_BASEURL="https://localhost:3457/api" | ||
HARNESS_CLIENTS_NGMANAGER_SECURE=false | ||
HARNESS_CLIENTS_NGMANAGER_BASEURL="https://localhost:7457" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
GITNESS_TRACE=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright 2021 Harness Inc. All rights reserved. | ||
// Use of this source code is governed by the Polyform Free Trial License | ||
// that can be found in the LICENSE.md file for this repository. | ||
|
||
//go:build wireinject && harness | ||
// +build wireinject,harness | ||
|
||
package server | ||
|
||
import ( | ||
"github.com/harness/gitness/harness" | ||
"github.com/harness/gitness/harness/auth/authn" | ||
"github.com/harness/gitness/harness/auth/authz" | ||
"github.com/harness/gitness/harness/client" | ||
"github.com/harness/gitness/harness/router/translator" | ||
"github.com/harness/gitness/internal/cron" | ||
"github.com/harness/gitness/internal/router" | ||
"github.com/harness/gitness/internal/server" | ||
"github.com/harness/gitness/internal/store/database" | ||
"github.com/harness/gitness/internal/store/memory" | ||
"github.com/harness/gitness/types" | ||
|
||
"github.com/google/wire" | ||
) | ||
|
||
func initSystem(config *types.Config) (*system, error) { | ||
wire.Build( | ||
newSystem, | ||
database.WireSet, | ||
memory.WireSet, | ||
router.WireSet, | ||
server.WireSet, | ||
cron.WireSet, | ||
harness.LoadConfig, | ||
authn.WireSet, | ||
authz.WireSet, | ||
client.WireSet, | ||
translator.WireSet, | ||
) | ||
return &system{}, nil | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.