-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from canonical/IAM-868
Patch Kratos
- Loading branch information
Showing
2 changed files
with
36 additions
and
4 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,22 @@ | ||
diff --git a/hydra/hydra.go b/hydra/hydra.go | ||
index a4466307e..915489545 100644 | ||
--- a/hydra/hydra.go | ||
+++ b/hydra/hydra.go | ||
@@ -72,7 +72,7 @@ func (h *DefaultHydra) getAdminURL(ctx context.Context) (string, error) { | ||
return u.String(), nil | ||
} | ||
|
||
-func (h *DefaultHydra) getAdminAPIClient(ctx context.Context) (*hydraclientgo.OAuth2ApiService, error) { | ||
+func (h *DefaultHydra) getAdminAPIClient(ctx context.Context) (*hydraclientgo.OAuth2APIService, error) { | ||
url, err := h.getAdminURL(ctx) | ||
if err != nil { | ||
return nil, err | ||
@@ -87,7 +87,7 @@ func (h *DefaultHydra) getAdminAPIClient(ctx context.Context) (*hydraclientgo.OA | ||
} | ||
|
||
configuration.HTTPClient = client | ||
- return hydraclientgo.NewAPIClient(configuration).OAuth2Api, nil | ||
+ return hydraclientgo.NewAPIClient(configuration).OAuth2API.(*hydraclientgo.OAuth2APIService), nil | ||
} | ||
|
||
func (h *DefaultHydra) AcceptLoginRequest(ctx context.Context, params AcceptLoginRequestParams) (string, error) { |
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 |
---|---|---|
|
@@ -22,7 +22,7 @@ parts: | |
stage-packages: | ||
# This is needed to pipe the stdout/stderr to a file for log forwarding and to update certificates | ||
- coreutils | ||
|
||
openssl: | ||
plugin: nil | ||
stage-packages: | ||
|
@@ -44,7 +44,7 @@ parts: | |
mkdir -p $CRAFT_PART_INSTALL/usr/share/ca-certificates/mozilla/ | ||
mkdir -p $CRAFT_PART_INSTALL/usr/sbin | ||
mkdir -p $CRAFT_PART_INSTALL/tmp | ||
touch $CRAFT_PART_INSTALL/etc/ssl/certs/ca-certificates.crt | ||
touch $CRAFT_PART_INSTALL/etc/ca-certificates.conf | ||
for cert in /usr/share/ca-certificates/mozilla/* ; do | ||
|
@@ -60,7 +60,7 @@ parts: | |
plugin: nil | ||
stage-packages: | ||
- sed | ||
|
||
find: | ||
plugin: nil | ||
stage-packages: | ||
|
@@ -73,11 +73,20 @@ parts: | |
build-snaps: | ||
- go/1.21/stable | ||
build-environment: | ||
- CGO_ENABLED: 0 | ||
- CGO_ENABLED: "0" | ||
source: https://github.com/ory/kratos | ||
source-type: git | ||
source-tag: v1.1.0 | ||
override-build: | | ||
# Patch the repo and replace the hydra sdk version | ||
# Workaround for https://github.com/ory/kratos/issues/3904 | ||
# TODO(nsklikas): Remove when issue is fixed | ||
cp $CRAFT_PROJECT_DIR/kratos.patch . | ||
git apply -v kratos.patch | ||
go mod edit -replace github.com/ory/hydra-client-go/v2=github.com/ory/hydra-client-go/[email protected] | ||
go mod tidy | ||
# Set the necessary flags | ||
src_config_path="github.com/ory/kratos/driver" | ||
build_ver="${src_config_path}/config.Version" | ||
build_hash="${src_config_path}/config.Commit" | ||
|
@@ -88,5 +97,6 @@ parts: | |
-X ${build_hash}=$(git -C "${CRAFT_PART_SRC}" rev-parse HEAD) \ | ||
-X ${build_date}=$(date -u +%Y-%m-%dT%H:%M:%SZ)" | ||
# Build the binary | ||
go mod download | ||
go build -ldflags="${go_linker_flags}" -o ${CRAFT_PART_INSTALL}/bin/kratos |