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
18 changes: 9 additions & 9 deletions src/console/console.did
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ type AuthenticationConfigInternetIdentity = record {
};
type AuthenticationConfigOpenId = record {
observatory_id : opt principal;
providers : vec record { OpenIdDelegationProvider; OpenIdProviderConfig };
providers : vec record { OpenIdDelegationProvider; OpenIdAuthProviderConfig };
};
type AuthenticationError = variant {
PrepareDelegation : PrepareDelegationError;
Expand Down Expand Up @@ -224,6 +224,14 @@ type ListSegmentsArgs = record {
};
type Memory = variant { Heap; Stable };
type OpenId = record { provider : OpenIdDelegationProvider; data : OpenIdData };
type OpenIdAuthProviderConfig = record {
delegation : opt OpenIdAuthProviderDelegationConfig;
client_id : text;
};
type OpenIdAuthProviderDelegationConfig = record {
targets : opt vec principal;
max_time_to_live : opt nat64;
};
type OpenIdData = record {
name : opt text;
locale : opt text;
Expand All @@ -245,14 +253,6 @@ type OpenIdPrepareDelegationArgs = record {
session_key : blob;
salt : blob;
};
type OpenIdProviderConfig = record {
delegation : opt OpenIdProviderDelegationConfig;
client_id : text;
};
type OpenIdProviderDelegationConfig = record {
targets : opt vec principal;
max_time_to_live : opt nat64;
};
type PaymentStatus = variant { Refunded; Acknowledged; Completed };
type PrepareDelegationError = variant {
JwtFindProvider : JwtFindProviderError;
Expand Down
6 changes: 3 additions & 3 deletions src/console/src/auth/delegation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use junobuild_auth::delegation::types::{
};
use junobuild_auth::openid::delegation::types::interface::OpenIdCredential;
use junobuild_auth::openid::delegation::types::provider::OpenIdDelegationProvider;
use junobuild_auth::state::types::config::OpenIdProviders;
use junobuild_auth::state::types::config::OpenIdAuthProviders;
use junobuild_auth::{delegation, openid};

pub type OpenIdPrepareDelegationResult = Result<
Expand All @@ -20,7 +20,7 @@ pub type OpenIdPrepareDelegationResult = Result<

pub async fn openid_prepare_delegation(
args: &OpenIdPrepareDelegationArgs,
providers: &OpenIdProviders,
providers: &OpenIdAuthProviders,
) -> OpenIdPrepareDelegationResult {
let (credential, provider) =
match openid::delegation::verify_openid_credentials_with_jwks_renewal(
Expand All @@ -45,7 +45,7 @@ pub async fn openid_prepare_delegation(

pub fn openid_get_delegation(
args: &OpenIdGetDelegationArgs,
providers: &OpenIdProviders,
providers: &OpenIdAuthProviders,
) -> GetDelegationResult {
let (credential, provider) =
match openid::delegation::verify_openid_credentials_with_cached_jwks(
Expand Down
18 changes: 9 additions & 9 deletions src/declarations/console/console.did.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export interface AuthenticationConfigInternetIdentity {
}
export interface AuthenticationConfigOpenId {
observatory_id: [] | [Principal];
providers: Array<[OpenIdDelegationProvider, OpenIdProviderConfig]>;
providers: Array<[OpenIdDelegationProvider, OpenIdAuthProviderConfig]>;
}
export type AuthenticationError =
| {
Expand Down Expand Up @@ -280,6 +280,14 @@ export interface OpenId {
provider: OpenIdDelegationProvider;
data: OpenIdData;
}
export interface OpenIdAuthProviderConfig {
delegation: [] | [OpenIdAuthProviderDelegationConfig];
client_id: string;
}
export interface OpenIdAuthProviderDelegationConfig {
targets: [] | [Array<Principal>];
max_time_to_live: [] | [bigint];
}
export interface OpenIdData {
name: [] | [string];
locale: [] | [string];
Expand All @@ -301,14 +309,6 @@ export interface OpenIdPrepareDelegationArgs {
session_key: Uint8Array;
salt: Uint8Array;
}
export interface OpenIdProviderConfig {
delegation: [] | [OpenIdProviderDelegationConfig];
client_id: string;
}
export interface OpenIdProviderDelegationConfig {
targets: [] | [Array<Principal>];
max_time_to_live: [] | [bigint];
}
export type PaymentStatus = { Refunded: null } | { Acknowledged: null } | { Completed: null };
export type PrepareDelegationError =
| {
Expand Down
8 changes: 4 additions & 4 deletions src/declarations/console/console.factory.certified.did.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,17 @@ export const idlFactory = ({ IDL }) => {
const DeleteProposalAssets = IDL.Record({
proposal_ids: IDL.Vec(IDL.Nat)
});
const OpenIdProviderDelegationConfig = IDL.Record({
const OpenIdAuthProviderDelegationConfig = IDL.Record({
targets: IDL.Opt(IDL.Vec(IDL.Principal)),
max_time_to_live: IDL.Opt(IDL.Nat64)
});
const OpenIdProviderConfig = IDL.Record({
delegation: IDL.Opt(OpenIdProviderDelegationConfig),
const OpenIdAuthProviderConfig = IDL.Record({
delegation: IDL.Opt(OpenIdAuthProviderDelegationConfig),
client_id: IDL.Text
});
const AuthenticationConfigOpenId = IDL.Record({
observatory_id: IDL.Opt(IDL.Principal),
providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdProviderConfig))
providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdAuthProviderConfig))
});
const AuthenticationConfigInternetIdentity = IDL.Record({
derivation_origin: IDL.Opt(IDL.Text),
Expand Down
8 changes: 4 additions & 4 deletions src/declarations/console/console.factory.did.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,17 @@ export const idlFactory = ({ IDL }) => {
const DeleteProposalAssets = IDL.Record({
proposal_ids: IDL.Vec(IDL.Nat)
});
const OpenIdProviderDelegationConfig = IDL.Record({
const OpenIdAuthProviderDelegationConfig = IDL.Record({
targets: IDL.Opt(IDL.Vec(IDL.Principal)),
max_time_to_live: IDL.Opt(IDL.Nat64)
});
const OpenIdProviderConfig = IDL.Record({
delegation: IDL.Opt(OpenIdProviderDelegationConfig),
const OpenIdAuthProviderConfig = IDL.Record({
delegation: IDL.Opt(OpenIdAuthProviderDelegationConfig),
client_id: IDL.Text
});
const AuthenticationConfigOpenId = IDL.Record({
observatory_id: IDL.Opt(IDL.Principal),
providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdProviderConfig))
providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdAuthProviderConfig))
});
const AuthenticationConfigInternetIdentity = IDL.Record({
derivation_origin: IDL.Opt(IDL.Text),
Expand Down
8 changes: 4 additions & 4 deletions src/declarations/console/console.factory.did.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,17 @@ export const idlFactory = ({ IDL }) => {
const DeleteProposalAssets = IDL.Record({
proposal_ids: IDL.Vec(IDL.Nat)
});
const OpenIdProviderDelegationConfig = IDL.Record({
const OpenIdAuthProviderDelegationConfig = IDL.Record({
targets: IDL.Opt(IDL.Vec(IDL.Principal)),
max_time_to_live: IDL.Opt(IDL.Nat64)
});
const OpenIdProviderConfig = IDL.Record({
delegation: IDL.Opt(OpenIdProviderDelegationConfig),
const OpenIdAuthProviderConfig = IDL.Record({
delegation: IDL.Opt(OpenIdAuthProviderDelegationConfig),
client_id: IDL.Text
});
const AuthenticationConfigOpenId = IDL.Record({
observatory_id: IDL.Opt(IDL.Principal),
providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdProviderConfig))
providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdAuthProviderConfig))
});
const AuthenticationConfigInternetIdentity = IDL.Record({
derivation_origin: IDL.Opt(IDL.Text),
Expand Down
18 changes: 9 additions & 9 deletions src/declarations/satellite/satellite.did.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export interface AuthenticationConfigInternetIdentity {
}
export interface AuthenticationConfigOpenId {
observatory_id: [] | [Principal];
providers: Array<[OpenIdDelegationProvider, OpenIdProviderConfig]>;
providers: Array<[OpenIdDelegationProvider, OpenIdAuthProviderConfig]>;
}
export type AuthenticationError =
| {
Expand Down Expand Up @@ -259,6 +259,14 @@ export interface MemorySize {
stable: bigint;
heap: bigint;
}
export interface OpenIdAuthProviderConfig {
delegation: [] | [OpenIdAuthProviderDelegationConfig];
client_id: string;
}
export interface OpenIdAuthProviderDelegationConfig {
targets: [] | [Array<Principal>];
max_time_to_live: [] | [bigint];
}
export type OpenIdDelegationProvider = { GitHub: null } | { Google: null };
export interface OpenIdGetDelegationArgs {
jwt: string;
Expand All @@ -271,14 +279,6 @@ export interface OpenIdPrepareDelegationArgs {
session_key: Uint8Array;
salt: Uint8Array;
}
export interface OpenIdProviderConfig {
delegation: [] | [OpenIdProviderDelegationConfig];
client_id: string;
}
export interface OpenIdProviderDelegationConfig {
targets: [] | [Array<Principal>];
max_time_to_live: [] | [bigint];
}
export type Permission =
| { Controllers: null }
| { Private: null }
Expand Down
8 changes: 4 additions & 4 deletions src/declarations/satellite/satellite.factory.certified.did.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,17 @@ export const idlFactory = ({ IDL }) => {
GitHub: IDL.Null,
Google: IDL.Null
});
const OpenIdProviderDelegationConfig = IDL.Record({
const OpenIdAuthProviderDelegationConfig = IDL.Record({
targets: IDL.Opt(IDL.Vec(IDL.Principal)),
max_time_to_live: IDL.Opt(IDL.Nat64)
});
const OpenIdProviderConfig = IDL.Record({
delegation: IDL.Opt(OpenIdProviderDelegationConfig),
const OpenIdAuthProviderConfig = IDL.Record({
delegation: IDL.Opt(OpenIdAuthProviderDelegationConfig),
client_id: IDL.Text
});
const AuthenticationConfigOpenId = IDL.Record({
observatory_id: IDL.Opt(IDL.Principal),
providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdProviderConfig))
providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdAuthProviderConfig))
});
const AuthenticationConfigInternetIdentity = IDL.Record({
derivation_origin: IDL.Opt(IDL.Text),
Expand Down
8 changes: 4 additions & 4 deletions src/declarations/satellite/satellite.factory.did.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,17 @@ export const idlFactory = ({ IDL }) => {
GitHub: IDL.Null,
Google: IDL.Null
});
const OpenIdProviderDelegationConfig = IDL.Record({
const OpenIdAuthProviderDelegationConfig = IDL.Record({
targets: IDL.Opt(IDL.Vec(IDL.Principal)),
max_time_to_live: IDL.Opt(IDL.Nat64)
});
const OpenIdProviderConfig = IDL.Record({
delegation: IDL.Opt(OpenIdProviderDelegationConfig),
const OpenIdAuthProviderConfig = IDL.Record({
delegation: IDL.Opt(OpenIdAuthProviderDelegationConfig),
client_id: IDL.Text
});
const AuthenticationConfigOpenId = IDL.Record({
observatory_id: IDL.Opt(IDL.Principal),
providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdProviderConfig))
providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdAuthProviderConfig))
});
const AuthenticationConfigInternetIdentity = IDL.Record({
derivation_origin: IDL.Opt(IDL.Text),
Expand Down
8 changes: 4 additions & 4 deletions src/declarations/satellite/satellite.factory.did.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,17 @@ export const idlFactory = ({ IDL }) => {
GitHub: IDL.Null,
Google: IDL.Null
});
const OpenIdProviderDelegationConfig = IDL.Record({
const OpenIdAuthProviderDelegationConfig = IDL.Record({
targets: IDL.Opt(IDL.Vec(IDL.Principal)),
max_time_to_live: IDL.Opt(IDL.Nat64)
});
const OpenIdProviderConfig = IDL.Record({
delegation: IDL.Opt(OpenIdProviderDelegationConfig),
const OpenIdAuthProviderConfig = IDL.Record({
delegation: IDL.Opt(OpenIdAuthProviderDelegationConfig),
client_id: IDL.Text
});
const AuthenticationConfigOpenId = IDL.Record({
observatory_id: IDL.Opt(IDL.Principal),
providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdProviderConfig))
providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdAuthProviderConfig))
});
const AuthenticationConfigInternetIdentity = IDL.Record({
derivation_origin: IDL.Opt(IDL.Text),
Expand Down
18 changes: 9 additions & 9 deletions src/declarations/sputnik/sputnik.did.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export interface AuthenticationConfigInternetIdentity {
}
export interface AuthenticationConfigOpenId {
observatory_id: [] | [Principal];
providers: Array<[OpenIdDelegationProvider, OpenIdProviderConfig]>;
providers: Array<[OpenIdDelegationProvider, OpenIdAuthProviderConfig]>;
}
export type AuthenticationError =
| {
Expand Down Expand Up @@ -259,6 +259,14 @@ export interface MemorySize {
stable: bigint;
heap: bigint;
}
export interface OpenIdAuthProviderConfig {
delegation: [] | [OpenIdAuthProviderDelegationConfig];
client_id: string;
}
export interface OpenIdAuthProviderDelegationConfig {
targets: [] | [Array<Principal>];
max_time_to_live: [] | [bigint];
}
export type OpenIdDelegationProvider = { GitHub: null } | { Google: null };
export interface OpenIdGetDelegationArgs {
jwt: string;
Expand All @@ -271,14 +279,6 @@ export interface OpenIdPrepareDelegationArgs {
session_key: Uint8Array;
salt: Uint8Array;
}
export interface OpenIdProviderConfig {
delegation: [] | [OpenIdProviderDelegationConfig];
client_id: string;
}
export interface OpenIdProviderDelegationConfig {
targets: [] | [Array<Principal>];
max_time_to_live: [] | [bigint];
}
export type Permission =
| { Controllers: null }
| { Private: null }
Expand Down
8 changes: 4 additions & 4 deletions src/declarations/sputnik/sputnik.factory.certified.did.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,17 @@ export const idlFactory = ({ IDL }) => {
GitHub: IDL.Null,
Google: IDL.Null
});
const OpenIdProviderDelegationConfig = IDL.Record({
const OpenIdAuthProviderDelegationConfig = IDL.Record({
targets: IDL.Opt(IDL.Vec(IDL.Principal)),
max_time_to_live: IDL.Opt(IDL.Nat64)
});
const OpenIdProviderConfig = IDL.Record({
delegation: IDL.Opt(OpenIdProviderDelegationConfig),
const OpenIdAuthProviderConfig = IDL.Record({
delegation: IDL.Opt(OpenIdAuthProviderDelegationConfig),
client_id: IDL.Text
});
const AuthenticationConfigOpenId = IDL.Record({
observatory_id: IDL.Opt(IDL.Principal),
providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdProviderConfig))
providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdAuthProviderConfig))
});
const AuthenticationConfigInternetIdentity = IDL.Record({
derivation_origin: IDL.Opt(IDL.Text),
Expand Down
8 changes: 4 additions & 4 deletions src/declarations/sputnik/sputnik.factory.did.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,17 @@ export const idlFactory = ({ IDL }) => {
GitHub: IDL.Null,
Google: IDL.Null
});
const OpenIdProviderDelegationConfig = IDL.Record({
const OpenIdAuthProviderDelegationConfig = IDL.Record({
targets: IDL.Opt(IDL.Vec(IDL.Principal)),
max_time_to_live: IDL.Opt(IDL.Nat64)
});
const OpenIdProviderConfig = IDL.Record({
delegation: IDL.Opt(OpenIdProviderDelegationConfig),
const OpenIdAuthProviderConfig = IDL.Record({
delegation: IDL.Opt(OpenIdAuthProviderDelegationConfig),
client_id: IDL.Text
});
const AuthenticationConfigOpenId = IDL.Record({
observatory_id: IDL.Opt(IDL.Principal),
providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdProviderConfig))
providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdAuthProviderConfig))
});
const AuthenticationConfigInternetIdentity = IDL.Record({
derivation_origin: IDL.Opt(IDL.Text),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

interface Props {
satellite: Satellite;
delegation: SatelliteDid.OpenIdProviderDelegationConfig | undefined;
delegation: SatelliteDid.OpenIdAuthProviderDelegationConfig | undefined;
allowedTargets: PrincipalText[] | null | undefined;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { SatelliteDid } from '$declarations';
import type { OpenIdProviderDelegationConfig } from '$declarations/satellite/satellite.did';
import type { OpenIdAuthProviderDelegationConfig } from '$declarations/satellite/satellite.did';
import { getAuthConfig as getAuthConfigApi, setAuthConfig, setRule } from '$lib/api/satellites.api';
import {
AUTH_DEFAULT_MAX_SESSION_TIME_TO_LIVE,
Expand Down Expand Up @@ -326,7 +326,7 @@ const updateConfigGoogle = async ({
return { result: 'skip' };
}

const updateDelegation: OpenIdProviderDelegationConfig | undefined = nonNullish(
const updateDelegation: OpenIdAuthProviderDelegationConfig | undefined = nonNullish(
updateMaxTimeToLive
)
? {
Expand Down
Loading