;
+
+export const Default: Story = {
+ args: {
+ contentLength: "normal",
+ },
+};
+
+export const WithHeader: Story = {
+ args: {
+ includeHeader: true,
+ },
+};
+
+export const WithFooter: Story = {
+ args: {
+ includeFooter: true,
+ },
+};
+
+export const WithHeaderAndFooter: Story = {
+ args: {
+ includeHeader: true,
+ includeFooter: true,
+ },
+};
+
+export const LongContent: Story = {
+ args: {
+ contentLength: "long",
+ includeHeader: true,
+ includeFooter: true,
+ },
+};
+
+export const ThinContent: Story = {
+ args: {
+ contentLength: "thin",
+ includeHeader: true,
+ includeFooter: true,
+ },
+};
+
+export const NoBackgroundIllustration: Story = {
+ args: {
+ hideBackgroundIllustration: true,
+ includeHeader: true,
+ includeFooter: true,
+ },
+};
+
+export const MinimalState: Story = {
+ args: {
+ contentLength: "thin",
+ hideBackgroundIllustration: true,
+ includeHeader: false,
+ includeFooter: false,
+ },
+};
diff --git a/libs/components/src/navigation/side-nav.component.html b/libs/components/src/navigation/side-nav.component.html
index 6b53c525e3a..b70d650622a 100644
--- a/libs/components/src/navigation/side-nav.component.html
+++ b/libs/components/src/navigation/side-nav.component.html
@@ -27,7 +27,7 @@
@if (data.open) {
diff --git a/libs/key-management/src/key.service.spec.ts b/libs/key-management/src/key.service.spec.ts
index 9d96d7c09b1..85129aaedf4 100644
--- a/libs/key-management/src/key.service.spec.ts
+++ b/libs/key-management/src/key.service.spec.ts
@@ -1,6 +1,7 @@
import { mock } from "jest-mock-extended";
import { BehaviorSubject, bufferCount, firstValueFrom, lastValueFrom, of, take } from "rxjs";
+import { ClientType } from "@bitwarden/client-type";
import { EncryptedOrganizationKeyData } from "@bitwarden/common/admin-console/models/data/encrypted-organization-key.data";
import { KeyGenerationService } from "@bitwarden/common/key-management/crypto";
import { CryptoFunctionService } from "@bitwarden/common/key-management/crypto/abstractions/crypto-function.service";
@@ -259,7 +260,18 @@ describe("keyService", () => {
});
});
- it("clears the Auto key if vault timeout is set to anything other than null", async () => {
+ it("sets an Auto key if vault timeout is set to 10 minutes and is Cli", async () => {
+ await stateProvider.setUserState(VAULT_TIMEOUT, 10, mockUserId);
+ platformUtilService.getClientType.mockReturnValue(ClientType.Cli);
+
+ await keyService.setUserKey(mockUserKey, mockUserId);
+
+ expect(stateService.setUserKeyAutoUnlock).toHaveBeenCalledWith(mockUserKey.keyB64, {
+ userId: mockUserId,
+ });
+ });
+
+ it("clears the Auto key if vault timeout is set to 10 minutes", async () => {
await stateProvider.setUserState(VAULT_TIMEOUT, 10, mockUserId);
await keyService.setUserKey(mockUserKey, mockUserId);
diff --git a/libs/key-management/src/key.service.ts b/libs/key-management/src/key.service.ts
index 4c749e9f6c4..d0b68229ea9 100644
--- a/libs/key-management/src/key.service.ts
+++ b/libs/key-management/src/key.service.ts
@@ -14,6 +14,7 @@ import {
switchMap,
} from "rxjs";
+import { ClientType } from "@bitwarden/client-type";
import { EncryptedOrganizationKeyData } from "@bitwarden/common/admin-console/models/data/encrypted-organization-key.data";
import { BaseEncryptedOrganizationKey } from "@bitwarden/common/admin-console/models/domain/encrypted-organization-key";
import { ProfileOrganizationResponse } from "@bitwarden/common/admin-console/models/response/profile-organization.response";
@@ -671,9 +672,13 @@ export class DefaultKeyService implements KeyServiceAbstraction {
}
protected async shouldStoreKey(keySuffix: KeySuffixOptions, userId: UserId) {
- let shouldStoreKey = false;
switch (keySuffix) {
case KeySuffixOptions.Auto: {
+ // Cli has fixed Never vault timeout, and it should not be affected by a policy.
+ if (this.platformUtilService.getClientType() == ClientType.Cli) {
+ return true;
+ }
+
// TODO: Sharing the UserKeyDefinition is temporary to get around a circ dep issue between
// the VaultTimeoutSettingsSvc and this service.
// This should be fixed as part of the PM-7082 - Auto Key Service work.
@@ -683,11 +688,14 @@ export class DefaultKeyService implements KeyServiceAbstraction {
.pipe(filter((timeout) => timeout != null)),
);
- shouldStoreKey = vaultTimeout == VaultTimeoutStringType.Never;
- break;
+ this.logService.debug(
+ `[KeyService] Should store auto key for vault timeout ${vaultTimeout}`,
+ );
+
+ return vaultTimeout == VaultTimeoutStringType.Never;
}
}
- return shouldStoreKey;
+ return false;
}
protected async getKeyFromStorage(
diff --git a/libs/vault/src/components/new-cipher-menu/new-cipher-menu.component.html b/libs/vault/src/components/new-cipher-menu/new-cipher-menu.component.html
index 00cfa701529..268f5b912d1 100644
--- a/libs/vault/src/components/new-cipher-menu/new-cipher-menu.component.html
+++ b/libs/vault/src/components/new-cipher-menu/new-cipher-menu.component.html
@@ -8,7 +8,7 @@
id="newItemDropdown"
[appA11yTitle]="'new' | i18n"
>
-
+
{{ "new" | i18n }}