Skip to content

Commit

Permalink
Merge branch 'main' into sm/sm-1159
Browse files Browse the repository at this point in the history
  • Loading branch information
coltonhurst committed Apr 1, 2024
2 parents 20e2183 + 2e51d96 commit 317a125
Show file tree
Hide file tree
Showing 282 changed files with 6,160 additions and 3,238 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/build-desktop.yml
Expand Up @@ -444,7 +444,10 @@ jobs:

macos-build:
name: MacOS Build
runs-on: macos-13
# Note, this workflow is running on macOS 11 to maintain compatibility with macOS 10.15 Catalina,
# as the newer versions will case the native modules to be incompatible with older macOS systems
# This version should stay pinned until we drop support for macOS 10.15, or we drop the native modules
runs-on: macos-11
needs: setup
env:
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
Expand Down Expand Up @@ -602,7 +605,10 @@ jobs:

macos-package-github:
name: MacOS Package GitHub Release Assets
runs-on: macos-13
# Note, this workflow is running on macOS 11 to maintain compatibility with macOS 10.15 Catalina,
# as the newer versions will case the native modules to be incompatible with older macOS systems
# This version should stay pinned until we drop support for macOS 10.15, or we drop the native modules
runs-on: macos-11
needs:
- browser-build
- macos-build
Expand Down Expand Up @@ -808,7 +814,10 @@ jobs:

macos-package-mas:
name: MacOS Package Prod Release Asset
runs-on: macos-13
# Note, this workflow is running on macOS 11 to maintain compatibility with macOS 10.15 Catalina,
# as the newer versions will case the native modules to be incompatible with older macOS systems
# This version should stay pinned until we drop support for macOS 10.15, or we drop the native modules
runs-on: macos-11
needs:
- browser-build
- macos-build
Expand Down Expand Up @@ -1006,7 +1015,10 @@ jobs:
macos-package-dev:
name: MacOS Package Dev Release Asset
if: false # We need to look into how code signing works for dev
runs-on: macos-13
# Note, this workflow is running on macOS 11 to maintain compatibility with macOS 10.15 Catalina,
# as the newer versions will case the native modules to be incompatible with older macOS systems
# This version should stay pinned until we drop support for macOS 10.15, or we drop the native modules
runs-on: macos-11
needs:
- browser-build
- macos-build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-web.yml
Expand Up @@ -299,7 +299,7 @@ jobs:
keyvault: "bitwarden-ci"
secrets: "github-pat-bitwarden-devops-bot-repo-scope"

- name: Trigger web vault deploy
- name: Trigger web vault deploy using GitHub Run ID
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{ steps.retrieve-secret-pat.outputs.github-pat-bitwarden-devops-bot-repo-scope }}
Expand All @@ -311,7 +311,7 @@ jobs:
ref: 'main',
inputs: {
'environment': 'USDEV',
'branch-or-tag': 'main'
'build-web-run-id': '${{ github.run_id }}'
}
})
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/deploy-web.yml
Expand Up @@ -27,6 +27,10 @@ on:
description: "Debug mode"
type: boolean
default: true
build-web-run-id:
description: "Build-web workflow Run ID to use for artifact download"
type: string
required: false

workflow_call:
inputs:
Expand All @@ -46,6 +50,10 @@ on:
description: "Debug mode"
type: boolean
default: true
build-web-run-id:
description: "Build-web workflow Run ID to use for artifact download"
type: string
required: false

permissions:
deployments: write
Expand Down Expand Up @@ -168,7 +176,20 @@ jobs:
env:
_ENVIRONMENT_ARTIFACT: ${{ needs.setup.outputs.environment-artifact }}
steps:
- name: 'Download latest cloud asset using GitHub Run ID: ${{ inputs.build-web-run-id }}'
if: ${{ inputs.build-web-run-id }}
uses: bitwarden/gh-actions/download-artifacts@main
id: download-latest-artifacts
continue-on-error: true
with:
workflow: build-web.yml
path: apps/web
workflow_conclusion: success
run_id: ${{ inputs.build-web-run-id }}
artifacts: ${{ env._ENVIRONMENT_ARTIFACT }}

- name: 'Download latest cloud asset from branch/tag: ${{ inputs.branch-or-tag }}'
if: ${{ !inputs.build-web-run-id }}
uses: bitwarden/gh-actions/download-artifacts@main
id: download-artifacts
continue-on-error: true
Expand Down Expand Up @@ -249,7 +270,20 @@ jobs:
keyvault: ${{ needs.setup.outputs.retrieve-secrets-keyvault }}
secrets: "sa-bitwarden-web-vault-name,sp-bitwarden-web-vault-password,sp-bitwarden-web-vault-appid,sp-bitwarden-web-vault-tenant"

- name: 'Download latest cloud asset using GitHub Run ID: ${{ inputs.build-web-run-id }}'
if: ${{ inputs.build-web-run-id }}
uses: bitwarden/gh-actions/download-artifacts@main
id: download-latest-artifacts
continue-on-error: true
with:
workflow: build-web.yml
path: apps/web
workflow_conclusion: success
run_id: ${{ inputs.build-web-run-id }}
artifacts: ${{ env._ENVIRONMENT_ARTIFACT }}

- name: 'Download cloud asset from branch/tag: ${{ inputs.branch-or-tag }}'
if: ${{ !inputs.build-web-run-id }}
uses: bitwarden/gh-actions/download-artifacts@main
with:
workflow: build-web.yml
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/release-desktop-beta.yml
Expand Up @@ -393,7 +393,10 @@ jobs:

macos-build:
name: MacOS Build
runs-on: macos-13
# Note, this workflow is running on macOS 11 to maintain compatibility with macOS 10.15 Catalina,
# as the newer versions will case the native modules to be incompatible with older macOS systems
# This version should stay pinned until we drop support for macOS 10.15, or we drop the native modules
runs-on: macos-11
needs: setup
env:
_PACKAGE_VERSION: ${{ needs.setup.outputs.release-version }}
Expand Down Expand Up @@ -522,7 +525,10 @@ jobs:

macos-package-github:
name: MacOS Package GitHub Release Assets
runs-on: macos-13
# Note, this workflow is running on macOS 11 to maintain compatibility with macOS 10.15 Catalina,
# as the newer versions will case the native modules to be incompatible with older macOS systems
# This version should stay pinned until we drop support for macOS 10.15, or we drop the native modules
runs-on: macos-11
needs:
- setup
- macos-build
Expand Down Expand Up @@ -732,7 +738,10 @@ jobs:

macos-package-mas:
name: MacOS Package Prod Release Asset
runs-on: macos-13
# Note, this workflow is running on macOS 11 to maintain compatibility with macOS 10.15 Catalina,
# as the newer versions will case the native modules to be incompatible with older macOS systems
# This version should stay pinned until we drop support for macOS 10.15, or we drop the native modules
runs-on: macos-11
needs:
- setup
- macos-build
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/scan.yml
Expand Up @@ -10,8 +10,6 @@ on:
pull_request_target:
types: [opened, synchronize]

permissions: read-all

jobs:
check-run:
name: Check PR run
Expand All @@ -22,6 +20,8 @@ jobs:
runs-on: ubuntu-22.04
needs: check-run
permissions:
contents: read
pull-requests: write
security-events: write

steps:
Expand All @@ -43,14 +43,17 @@ jobs:
additional_params: --report-format sarif --output-path . ${{ env.INCREMENTAL }}

- name: Upload Checkmarx results to GitHub
uses: github/codeql-action/upload-sarif@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6
uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
with:
sarif_file: cx_result.sarif

quality:
name: Quality scan
runs-on: ubuntu-22.04
needs: check-run
permissions:
contents: read
pull-requests: write

steps:
- name: Check out repo
Expand Down
26 changes: 26 additions & 0 deletions apps/browser/.eslintrc.json
@@ -0,0 +1,26 @@
{
"env": {
"browser": true,
"webextensions": true
},
"overrides": [
{
"files": ["src/**/*.ts"],
"excludedFiles": [
"src/**/{content,popup,spec}/**/*.ts",
"src/**/autofill/{notification,overlay}/**/*.ts",
"src/**/autofill/**/{autofill-overlay-content,collect-autofill-content,dom-element-visibility,insert-autofill-content}.service.ts",
"src/**/*.spec.ts"
],
"rules": {
"no-restricted-globals": [
"error",
{
"name": "window",
"message": "The `window` object is not available in service workers and may not be available within the background script. Consider using `self`, `globalThis`, or another global property instead."
}
]
}
}
]
}
6 changes: 6 additions & 0 deletions apps/browser/src/_locales/en/messages.json
Expand Up @@ -2999,5 +2999,11 @@
"saveCipherAttemptFailed": {
"message": "Error saving credentials. Check console for details.",
"description": "Notification message for when saving credentials has failed."
},
"removePasskey": {
"message": "Remove passkey"
},
"passkeyRemoved": {
"message": "Passkey removed"
}
}
2 changes: 1 addition & 1 deletion apps/browser/src/_locales/id/messages.json
Expand Up @@ -20,7 +20,7 @@
"message": "Masuk"
},
"enterpriseSingleSignOn": {
"message": "Sistem Masuk Tunggal Perusahaan"
"message": "SSO Perusahaan"
},
"cancel": {
"message": "Batal"
Expand Down
2 changes: 1 addition & 1 deletion apps/browser/src/_locales/pt_PT/messages.json
Expand Up @@ -2913,7 +2913,7 @@
"message": "Mudar de conta"
},
"switchAccounts": {
"message": "Mudar de contas"
"message": "Mudar de conta"
},
"switchToAccount": {
"message": "Mudar para conta"
Expand Down
16 changes: 8 additions & 8 deletions apps/browser/src/_locales/zh_CN/messages.json
Expand Up @@ -1500,7 +1500,7 @@
"message": "无效 PIN 码。"
},
"tooManyInvalidPinEntryAttemptsLoggingOut": {
"message": "无效的 PIN 输入尝试次数过多,正在退出登录"
"message": "无效的 PIN 输入尝试次数过多,正在注销"
},
"unlockWithBiometrics": {
"message": "使用生物识别解锁"
Expand Down Expand Up @@ -1742,7 +1742,7 @@
"message": "Bitwarden 将不会询问是否为这些域名保存登录信息。您必须刷新页面才能使更改生效。"
},
"excludedDomainsDescAlt": {
"message": "Bitwarden 不会询问保存所有已登录的账户的这些域名的登录信息。您必须刷新页面才能使更改生效"
"message": "Bitwarden 不会询问保存所有已登录的账户的这些域名的登录信息。必须刷新页面才能使更改生效"
},
"excludedDomainsInvalidDomain": {
"message": "$DOMAIN$ 不是一个有效的域名",
Expand Down Expand Up @@ -2314,7 +2314,7 @@
"message": "如何自动填充"
},
"autofillSelectInfoWithCommand": {
"message": "从此界面选择一个项目,使用快捷方式 $COMMAND$,或探索设置中的其他选项。",
"message": "从此界面选择一个项目,使用快捷键 $COMMAND$,或探索设置中的其他选项。",
"placeholders": {
"command": {
"content": "$1",
Expand All @@ -2335,10 +2335,10 @@
"message": "自动填充键盘快捷键"
},
"autofillShortcutNotSet": {
"message": "未设置自动填充快捷方式。请在浏览器设置中更改此设置"
"message": "未设置自动填充快捷键。可在浏览器的设置中更改它"
},
"autofillShortcutText": {
"message": "自动填充快捷方式为: $COMMAND$。在浏览器设置中更改此项",
"message": "自动填充快捷键为:$COMMAND$。可在浏览器的设置中更改它",
"placeholders": {
"command": {
"content": "$1",
Expand Down Expand Up @@ -2928,7 +2928,7 @@
"message": "已达到账户上限。请注销一个账户后再添加其他账户。"
},
"active": {
"message": "已生效"
"message": "活动的"
},
"locked": {
"message": "已锁定"
Expand Down Expand Up @@ -2961,15 +2961,15 @@
}
},
"commonImportFormats": {
"message": "通用格式",
"message": "常规格式",
"description": "Label indicating the most common import formats"
},
"overrideDefaultBrowserAutofillTitle": {
"message": "将 Bitwarden 设置为您的默认密码管理器吗?",
"description": "Dialog title facilitating the ability to override a chrome browser's default autofill behavior"
},
"overrideDefaultBrowserAutofillDescription": {
"message": "忽略此设置可能会导致 Bitwarden 自动填充菜单与浏览器自带功能产生冲突。",
"message": "忽略此选项可能会导致 Bitwarden 自动填充菜单与浏览器自带功能产生冲突。",
"description": "Dialog message facilitating the ability to override a chrome browser's default autofill behavior"
},
"overrideDefaultBrowserAutoFillSettings": {
Expand Down
Expand Up @@ -23,9 +23,12 @@ import {
stateServiceFactory,
} from "../../../platform/background/service-factories/state-service.factory";

import { AccountServiceInitOptions, accountServiceFactory } from "./account-service.factory";

type AuthServiceFactoryOptions = FactoryOptions;

export type AuthServiceInitOptions = AuthServiceFactoryOptions &
AccountServiceInitOptions &
MessagingServiceInitOptions &
CryptoServiceInitOptions &
ApiServiceInitOptions &
Expand All @@ -41,6 +44,7 @@ export function authServiceFactory(
opts,
async () =>
new AuthService(
await accountServiceFactory(cache, opts),
await messagingServiceFactory(cache, opts),
await cryptoServiceFactory(cache, opts),
await apiServiceFactory(cache, opts),
Expand Down
Expand Up @@ -27,9 +27,9 @@ import {
LogServiceInitOptions,
} from "../../../platform/background/service-factories/log-service.factory";
import {
stateServiceFactory,
StateServiceInitOptions,
} from "../../../platform/background/service-factories/state-service.factory";
stateProviderFactory,
StateProviderInitOptions,
} from "../../../platform/background/service-factories/state-provider.factory";

import { TokenServiceInitOptions, tokenServiceFactory } from "./token-service.factory";

Expand All @@ -40,13 +40,13 @@ type KeyConnectorServiceFactoryOptions = FactoryOptions & {
};

export type KeyConnectorServiceInitOptions = KeyConnectorServiceFactoryOptions &
StateServiceInitOptions &
CryptoServiceInitOptions &
ApiServiceInitOptions &
TokenServiceInitOptions &
LogServiceInitOptions &
OrganizationServiceInitOptions &
KeyGenerationServiceInitOptions;
KeyGenerationServiceInitOptions &
StateProviderInitOptions;

export function keyConnectorServiceFactory(
cache: { keyConnectorService?: AbstractKeyConnectorService } & CachedServices,
Expand All @@ -58,14 +58,14 @@ export function keyConnectorServiceFactory(
opts,
async () =>
new KeyConnectorService(
await stateServiceFactory(cache, opts),
await cryptoServiceFactory(cache, opts),
await apiServiceFactory(cache, opts),
await tokenServiceFactory(cache, opts),
await logServiceFactory(cache, opts),
await organizationServiceFactory(cache, opts),
await keyGenerationServiceFactory(cache, opts),
opts.keyConnectorServiceOptions.logoutCallback,
await stateProviderFactory(cache, opts),
),
);
}

0 comments on commit 317a125

Please sign in to comment.