@spinnaker/core 2026.1.0 → 2026.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apitoken/ApiTokenService.d.ts +34 -0
- package/dist/apitoken/ApiTokensPage.d.ts +15 -0
- package/dist/apitoken/ApiTokensPageContainer.d.ts +2 -0
- package/dist/apitoken/CreateApiTokenModal.d.ts +20 -0
- package/dist/apitoken/RevokeApiTokenButton.d.ts +7 -0
- package/dist/apitoken/apitoken.module.d.ts +1 -0
- package/dist/apitoken/apitoken.states.d.ts +1 -0
- package/dist/apitoken/index.d.ts +6 -0
- package/dist/application/application.initializers.d.ts +7 -0
- package/dist/application/index.d.ts +2 -0
- package/dist/authentication/AuthenticationService.d.ts +1 -0
- package/dist/config/settings.d.ts +0 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +36 -36
- package/dist/index.js.map +1 -1
- package/dist/notification/selector/types/index.d.ts +0 -1
- package/package.json +12 -7
- package/rollup.config.js +16 -0
- package/src/apitoken/ApiTokenService.spec.ts +199 -0
- package/src/apitoken/ApiTokenService.ts +65 -0
- package/src/apitoken/ApiTokensPage.less +81 -0
- package/src/apitoken/ApiTokensPage.tsx +370 -0
- package/src/apitoken/ApiTokensPageContainer.tsx +85 -0
- package/src/apitoken/CreateApiTokenModal.tsx +228 -0
- package/src/apitoken/RevokeApiTokenButton.tsx +79 -0
- package/src/apitoken/apitoken.module.ts +20 -0
- package/src/apitoken/apitoken.states.ts +43 -0
- package/src/apitoken/index.ts +20 -0
- package/src/application/application.initializers.spec.ts +34 -0
- package/src/application/application.initializers.ts +40 -0
- package/src/application/application.module.ts +2 -0
- package/src/application/index.ts +6 -0
- package/src/authentication/AuthenticationInitializer.spec.ts +16 -0
- package/src/authentication/AuthenticationInitializer.ts +4 -0
- package/src/authentication/AuthenticationService.spec.ts +18 -0
- package/src/authentication/AuthenticationService.ts +3 -0
- package/src/authentication/userMenu/UserMenu.tsx +17 -3
- package/src/config/settings.ts +0 -1
- package/src/core.module.ts +2 -0
- package/src/index.ts +1 -0
- package/src/notification/notification.types.ts +0 -2
- package/src/notification/selector/types/index.ts +0 -1
- package/src/notification/selector/types/microsoftteams/MicrosoftTeamsNotificationType.tsx +1 -1
- package/dist/notification/selector/types/bearychat/BearychatNotificationType.d.ts +0 -5
- package/dist/notification/selector/types/bearychat/beary.notification.d.ts +0 -2
- package/src/notification/selector/types/bearychat/BearychatNotificationType.tsx +0 -19
- package/src/notification/selector/types/bearychat/beary.notification.ts +0 -8
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface IApiToken {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
principalType: 'USER' | 'SERVICE_ACCOUNT';
|
|
5
|
+
principalId: string;
|
|
6
|
+
createdByUserId: string;
|
|
7
|
+
/** Absent for non-expiring service account tokens. */
|
|
8
|
+
expiresAt?: string | null;
|
|
9
|
+
lastUsedAt?: string;
|
|
10
|
+
createdAt?: number;
|
|
11
|
+
lastModified?: number;
|
|
12
|
+
/** Only present immediately after creation. Never stored or returned again. */
|
|
13
|
+
token?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ICreateApiTokenRequest {
|
|
16
|
+
name: string;
|
|
17
|
+
principalType: 'USER' | 'SERVICE_ACCOUNT';
|
|
18
|
+
principalId?: string;
|
|
19
|
+
expiresAt?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface IApiTokenServiceAccount {
|
|
22
|
+
name: string;
|
|
23
|
+
memberOf?: string[];
|
|
24
|
+
}
|
|
25
|
+
export declare const ApiTokenService: {
|
|
26
|
+
listTokens(): PromiseLike<IApiToken[]>;
|
|
27
|
+
createToken(request: ICreateApiTokenRequest): PromiseLike<IApiToken & {
|
|
28
|
+
token: string;
|
|
29
|
+
}>;
|
|
30
|
+
revokeToken(id: string): PromiseLike<void>;
|
|
31
|
+
listApiTokenServiceAccounts(): PromiseLike<IApiTokenServiceAccount[]>;
|
|
32
|
+
/** Admin-only: returns all USER tokens across all principals. */
|
|
33
|
+
listAllUserTokens(): PromiseLike<IApiToken[]>;
|
|
34
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import './ApiTokensPage.less';
|
|
3
|
+
export interface IApiTokensPageProps {
|
|
4
|
+
isAdmin: boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Whether the user may mint personal tokens (from GET /auth/user → canMintApiTokens).
|
|
7
|
+
* When false, the "New Token" button is hidden; SA-token creation is gated on admin status.
|
|
8
|
+
*/
|
|
9
|
+
canMintApiTokens: boolean;
|
|
10
|
+
/** From GET /auth/user. Always pass the server value — never hard-code a fallback. */
|
|
11
|
+
maxUserTokenLifetimeDays: number;
|
|
12
|
+
/** From GET /auth/user. Always pass the server value — never hard-code a fallback. */
|
|
13
|
+
maxServiceAccountTokenLifetimeDays: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function ApiTokensPage({ isAdmin, canMintApiTokens, maxUserTokenLifetimeDays, maxServiceAccountTokenLifetimeDays, }: IApiTokensPageProps): JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { IApiToken, IApiTokenServiceAccount } from './ApiTokenService';
|
|
3
|
+
export type TokenContext = 'user' | 'serviceAccount';
|
|
4
|
+
export interface ICreateApiTokenModalProps {
|
|
5
|
+
context: TokenContext;
|
|
6
|
+
/**
|
|
7
|
+
* Max lifetime in days for this token type (from GET /auth/user). Caps the date picker.
|
|
8
|
+
* Always pass the server value — never hard-code a fallback.
|
|
9
|
+
*/
|
|
10
|
+
maxLifetimeDays: number;
|
|
11
|
+
/** Pre-loaded service accounts; avoids a redundant fetch from the modal. */
|
|
12
|
+
serviceAccounts?: IApiTokenServiceAccount[];
|
|
13
|
+
/** Names already owned by the current principal — for client-side duplicate detection. */
|
|
14
|
+
existingTokenNames?: Set<string>;
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
onCreated: (token: IApiToken & {
|
|
17
|
+
token: string;
|
|
18
|
+
}) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function CreateApiTokenModal({ context, maxLifetimeDays, serviceAccounts: serviceAccountsProp, existingTokenNames, onClose, onCreated, }: ICreateApiTokenModalProps): JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface IRevokeApiTokenButtonProps {
|
|
3
|
+
tokenId: string;
|
|
4
|
+
tokenName: string;
|
|
5
|
+
onRevoked: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function RevokeApiTokenButton({ tokenId, tokenName, onRevoked }: IRevokeApiTokenButtonProps): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const APITOKEN_MODULE = "spinnaker.core.apitoken";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const APITOKEN_STATES = "spinnaker.core.apitoken.states";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { UIRouter } from '@uirouter/core';
|
|
2
|
+
import type { ApplicationStateProvider } from './application.state.provider';
|
|
3
|
+
export type ApplicationInitializer = (applicationState: ApplicationStateProvider, uiRouter: UIRouter) => void;
|
|
4
|
+
export declare function registerApplicationInitializer(initializer: ApplicationInitializer): void;
|
|
5
|
+
export declare function applyApplicationInitializers(applicationState: ApplicationStateProvider, uiRouter: UIRouter): void;
|
|
6
|
+
export declare function resetApplicationInitializersForTests(): void;
|
|
7
|
+
export declare const APPLICATION_INITIALIZERS_MODULE = "spinnaker.core.application.initializers";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from './ApplicationContext';
|
|
2
2
|
export * from './ApplicationIcon';
|
|
3
|
+
export type { ApplicationInitializer } from './application.initializers';
|
|
4
|
+
export { APPLICATION_INITIALIZERS_MODULE, applyApplicationInitializers, registerApplicationInitializer, } from './application.initializers';
|
|
3
5
|
export * from './application.model';
|
|
4
6
|
export * from './application.state.provider';
|
|
5
7
|
export * from './applicationModel.builder';
|