-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Johannes Dillmann <[email protected]> Co-authored-by: Ralf Pannemans <[email protected]> Co-authored-by: Nicolas Bender <[email protected]>
- Loading branch information
1 parent
daffedc
commit 035baf5
Showing
21 changed files
with
421 additions
and
122 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
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
17 changes: 17 additions & 0 deletions
17
db/migrations/20240619161000_add_cnb_lifecycle_credentials.rb
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,17 @@ | ||
Sequel.migration do | ||
up do | ||
# rubocop:disable Migration/IncludeStringSize | ||
add_column :cnb_lifecycle_data, :encrypted_registry_credentials_json, String, if_not_exists: true | ||
# rubocop:enable Migration/IncludeStringSize | ||
add_column :cnb_lifecycle_data, :credentials_salt, String, size: 255, if_not_exists: true | ||
add_column :cnb_lifecycle_data, :encryption_key_label, String, size: 255, if_not_exists: true | ||
add_column :cnb_lifecycle_data, :encryption_iterations, Integer, default: 2048, null: false, if_not_exists: true | ||
end | ||
|
||
down do | ||
drop_column :cnb_lifecycle_data, :encrypted_registry_credentials_json, if_exists: true | ||
drop_column :cnb_lifecycle_data, :credentials_salt, if_exists: true | ||
drop_column :cnb_lifecycle_data, :encryption_key_label, if_exists: true | ||
drop_column :cnb_lifecycle_data, :encryption_iterations, if_exists: true | ||
end | ||
end |
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,43 @@ | ||
module VCAP::CloudController | ||
module Diego | ||
module Buildpack | ||
class LifecycleData | ||
attr_accessor :app_bits_download_uri, :build_artifacts_cache_download_uri, :build_artifacts_cache_upload_uri, | ||
:buildpacks, :app_bits_checksum, :droplet_upload_uri, :stack, :buildpack_cache_checksum | ||
|
||
def message | ||
message = { | ||
app_bits_download_uri:, | ||
build_artifacts_cache_upload_uri:, | ||
droplet_upload_uri:, | ||
buildpacks:, | ||
stack:, | ||
app_bits_checksum: | ||
} | ||
message[:build_artifacts_cache_download_uri] = build_artifacts_cache_download_uri if build_artifacts_cache_download_uri | ||
message[:buildpack_cache_checksum] = buildpack_cache_checksum if buildpack_cache_checksum | ||
|
||
schema.validate(message) | ||
message | ||
end | ||
|
||
private | ||
|
||
def schema | ||
@schema ||= Membrane::SchemaParser.parse do | ||
{ | ||
app_bits_download_uri: String, | ||
optional(:build_artifacts_cache_download_uri) => String, | ||
optional(:buildpack_cache_checksum) => String, | ||
build_artifacts_cache_upload_uri: String, | ||
droplet_upload_uri: String, | ||
buildpacks: Array, | ||
stack: String, | ||
app_bits_checksum: Hash | ||
} | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
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,46 @@ | ||
module VCAP::CloudController | ||
module Diego | ||
module CNB | ||
class LifecycleData | ||
attr_accessor :app_bits_download_uri, :build_artifacts_cache_download_uri, :build_artifacts_cache_upload_uri, | ||
:buildpacks, :app_bits_checksum, :droplet_upload_uri, :stack, :buildpack_cache_checksum, | ||
:credentials | ||
|
||
def message | ||
message = { | ||
app_bits_download_uri:, | ||
build_artifacts_cache_upload_uri:, | ||
droplet_upload_uri:, | ||
buildpacks:, | ||
stack:, | ||
app_bits_checksum: | ||
} | ||
message[:build_artifacts_cache_download_uri] = build_artifacts_cache_download_uri if build_artifacts_cache_download_uri | ||
message[:buildpack_cache_checksum] = buildpack_cache_checksum if buildpack_cache_checksum | ||
message[:credentials] = credentials if credentials | ||
|
||
schema.validate(message) | ||
message | ||
end | ||
|
||
private | ||
|
||
def schema | ||
@schema ||= Membrane::SchemaParser.parse do | ||
{ | ||
app_bits_download_uri: String, | ||
optional(:build_artifacts_cache_download_uri) => String, | ||
optional(:buildpack_cache_checksum) => String, | ||
build_artifacts_cache_upload_uri: String, | ||
droplet_upload_uri: String, | ||
buildpacks: Array, | ||
stack: String, | ||
app_bits_checksum: Hash, | ||
optional(:credentials) => String | ||
} | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
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 was deleted.
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
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.