Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion templates/eject/rust/src/satellite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ic-cdk = "0.19.0"
ic-cdk-macros = "0.19.0"
serde = "1.0.225"
serde_cbor = "0.11.2"
junobuild-satellite = "0.4.0"
junobuild-satellite = "0.5.0"
junobuild-macros = "0.2.0"
junobuild-utils = "0.2.0"

89 changes: 79 additions & 10 deletions templates/eject/rust/src/satellite/satellite.did
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,25 @@ type AssetNoContent = record {
version : opt nat64;
};
type AssetsUpgradeOptions = record { clear_existing_assets : opt bool };
type AuthenticateAutomationArgs = variant {
OpenId : OpenIdPrepareAutomationArgs;
};
type AuthenticateAutomationResultResponse = variant {
Ok : record { principal; AutomationController };
Err : AuthenticationAutomationError;
};
type AuthenticateResultResponse = variant {
Ok : Authentication;
Err : AuthenticationError;
};
type Authentication = record { doc : Doc; delegation : PreparedDelegation };
type AuthenticationArgs = variant { OpenId : OpenIdPrepareDelegationArgs };
type AuthenticationAutomationError = variant {
PrepareAutomation : PrepareAutomationError;
RegisterController : text;
SaveWorkflowMetadata : text;
SaveUniqueJtiToken : text;
};
type AuthenticationConfig = record {
updated_at : opt nat64;
openid : opt AuthenticationConfigOpenId;
Expand All @@ -40,13 +53,31 @@ type AuthenticationConfigInternetIdentity = record {
};
type AuthenticationConfigOpenId = record {
observatory_id : opt principal;
providers : vec record { OpenIdProvider; OpenIdProviderConfig };
providers : vec record { OpenIdDelegationProvider; OpenIdAuthProviderConfig };
};
type AuthenticationError = variant {
PrepareDelegation : PrepareDelegationError;
RegisterUser : text;
};
type AuthenticationRules = record { allowed_callers : vec principal };
type AutomationConfig = record {
updated_at : opt nat64;
openid : opt AutomationConfigOpenId;
created_at : opt nat64;
version : opt nat64;
};
type AutomationConfigOpenId = record {
observatory_id : opt principal;
providers : vec record {
OpenIdAutomationProvider;
OpenIdAutomationProviderConfig;
};
};
type AutomationController = record {
scope : AutomationScope;
expires_at : nat64;
};
type AutomationScope = variant { Write; Submit };
type CollectionType = variant { Db; Storage };
type CommitBatch = record {
batch_id : nat;
Expand All @@ -58,15 +89,18 @@ type Config = record {
db : opt DbConfig;
authentication : opt AuthenticationConfig;
storage : StorageConfig;
automation : opt AutomationConfig;
};
type ConfigMaxMemorySize = record { stable : opt nat64; heap : opt nat64 };
type Controller = record {
updated_at : nat64;
metadata : vec record { text; text };
kind : opt ControllerKind;
created_at : nat64;
scope : ControllerScope;
expires_at : opt nat64;
};
type ControllerKind = variant { Emulator; Automation };
type ControllerScope = variant { Write; Admin; Submit };
type CustomDomain = record {
updated_at : nat64;
Expand Down Expand Up @@ -106,6 +140,7 @@ type GetDelegationError = variant {
JwtVerify : JwtVerifyError;
GetOrFetchJwks : GetOrRefreshJwksError;
DeriveSeedFailed : text;
InvalidObservatoryId : text;
};
type GetDelegationResultResponse = variant {
Ok : SignedDelegation;
Expand Down Expand Up @@ -210,33 +245,55 @@ type ListRulesResults = record {
};
type Memory = variant { Heap; Stable };
type MemorySize = record { stable : nat64; heap : nat64 };
type OpenIdAuthProviderConfig = record {
delegation : opt OpenIdAuthProviderDelegationConfig;
client_id : text;
};
type OpenIdAuthProviderDelegationConfig = record {
targets : opt vec principal;
max_time_to_live : opt nat64;
};
type OpenIdAutomationProvider = variant { GitHub };
type OpenIdAutomationProviderConfig = record {
controller : opt OpenIdAutomationProviderControllerConfig;
repositories : vec record { RepositoryKey; OpenIdAutomationRepositoryConfig };
};
type OpenIdAutomationProviderControllerConfig = record {
scope : opt AutomationScope;
max_time_to_live : opt nat64;
};
type OpenIdAutomationRepositoryConfig = record { refs : opt vec text };
type OpenIdDelegationProvider = variant { GitHub; Google };
type OpenIdGetDelegationArgs = record {
jwt : text;
session_key : blob;
salt : blob;
expiration : nat64;
};
type OpenIdPrepareAutomationArgs = record { jwt : text; salt : blob };
type OpenIdPrepareDelegationArgs = record {
jwt : text;
session_key : blob;
salt : blob;
};
type OpenIdProvider = variant { Google };
type OpenIdProviderConfig = record {
delegation : opt OpenIdProviderDelegationConfig;
client_id : text;
};
type OpenIdProviderDelegationConfig = record {
targets : opt vec principal;
max_time_to_live : opt nat64;
};
type Permission = variant { Controllers; Private; Public; Managed };
type PrepareAutomationError = variant {
JwtFindProvider : JwtFindProviderError;
InvalidController : text;
GetCachedJwks;
JwtVerify : JwtVerifyError;
GetOrFetchJwks : GetOrRefreshJwksError;
ControllerAlreadyExists;
InvalidObservatoryId : text;
TooManyControllers : text;
};
type PrepareDelegationError = variant {
JwtFindProvider : JwtFindProviderError;
GetCachedJwks;
JwtVerify : JwtVerifyError;
GetOrFetchJwks : GetOrRefreshJwksError;
DeriveSeedFailed : text;
InvalidObservatoryId : text;
};
type PreparedDelegation = record { user_key : blob; expiration : nat64 };
type Proposal = record {
Expand All @@ -263,6 +320,7 @@ type ProposalType = variant {
SegmentsDeployment : SegmentsDeploymentOptions;
};
type RateConfig = record { max_tokens : nat64; time_per_token_ns : nat64 };
type RepositoryKey = record { owner : text; name : text };
type Rule = record {
max_capacity : opt nat32;
memory : opt Memory;
Expand All @@ -287,8 +345,13 @@ type SetAuthenticationConfig = record {
internet_identity : opt AuthenticationConfigInternetIdentity;
rules : opt AuthenticationRules;
};
type SetAutomationConfig = record {
openid : opt AutomationConfigOpenId;
version : opt nat64;
};
type SetController = record {
metadata : vec record { text; text };
kind : opt ControllerKind;
scope : ControllerScope;
expires_at : opt nat64;
};
Expand Down Expand Up @@ -373,6 +436,9 @@ type UploadChunk = record {
type UploadChunkResult = record { chunk_id : nat };
service : (InitSatelliteArgs) -> {
authenticate : (AuthenticationArgs) -> (AuthenticateResultResponse);
authenticate_automation : (AuthenticateAutomationArgs) -> (
AuthenticateAutomationResultResponse,
);
commit_asset_upload : (CommitBatch) -> ();
commit_proposal : (CommitProposal) -> (null);
commit_proposal_asset_upload : (CommitBatch) -> ();
Expand All @@ -384,6 +450,7 @@ service : (InitSatelliteArgs) -> {
count_proposals : () -> (nat64) query;
del_asset : (text, text) -> ();
del_assets : (text) -> ();
del_controller_self : () -> ();
del_controllers : (DeleteControllersArgs) -> (
vec record { principal; Controller },
);
Expand All @@ -399,6 +466,7 @@ service : (InitSatelliteArgs) -> {
deposit_cycles : (DepositCyclesArgs) -> ();
get_asset : (text, text) -> (opt AssetNoContent) query;
get_auth_config : () -> (opt AuthenticationConfig) query;
get_automation_config : () -> (opt AutomationConfig) query;
get_config : () -> (Config);
get_db_config : () -> (opt DbConfig) query;
get_delegation : (GetDelegationArgs) -> (GetDelegationResultResponse) query;
Expand Down Expand Up @@ -432,6 +500,7 @@ service : (InitSatelliteArgs) -> {
reject_proposal : (CommitProposal) -> (null);
set_asset_token : (text, text, opt text) -> ();
set_auth_config : (SetAuthenticationConfig) -> (AuthenticationConfig);
set_automation_config : (SetAutomationConfig) -> (AutomationConfig);
set_controllers : (SetControllersArgs) -> (
vec record { principal; Controller },
);
Expand Down