小编Max*_*uer的帖子

如何修复 npm 审计漏洞 Angular 12.0.3

在我创建新的 Angular 12.0.3 项目后,npm audit立即检测到 8 个高漏洞和 40 个中度漏洞。

# npm audit report

css-what  <5.0.1
Severity: high
Denial of Service - https://npmjs.com/advisories/1754
fix available via `npm audit fix --force`
Will install @angular-devkit/build-angular@0.1102.14, which is a breaking change
node_modules/css-what
  css-select  <=3.1.2
  Depends on vulnerable versions of css-what
  node_modules/css-select
    svgo  >=1.0.0
    Depends on vulnerable versions of css-select
    node_modules/svgo
      postcss-svgo  >=4.0.0-nightly.2020.1.9
      Depends on vulnerable versions of svgo
      node_modules/postcss-svgo
        cssnano-preset-default  *
        Depends on vulnerable versions of postcss-svgo
        node_modules/cssnano-preset-default
          cssnano  >=4.0.0-nightly.2020.1.9
          Depends on …
Run Code Online (Sandbox Code Playgroud)

npm angular npm-audit angular12

5
推荐指数
1
解决办法
7794
查看次数

firebase 云函数 context.auth 字段是否适用于 firestore?

使用firestore时是否可以通过context.auth属性获取触发云功能的用户的uid?

exports.updateReport = functions.firestore
.document('groups/{groupId}/reports/{nursingId}')
.onUpdate((change, context) => {
    const uid : string | undefined = context.auth?.uid;
})
Run Code Online (Sandbox Code Playgroud)

我发现很多关于同一问题的老问题有许多不同的答案。(该功能有效,该功能有时会工作,或者该功能永远不会工作)

在我的本地设置中,我context.auth总是未定义,所以我不知道我是否犯了错误,或者它根本不起作用。如果是这样的话,是否有其他安全的方式来获取触发相应云功能的用户的uid?

firebase google-cloud-platform google-cloud-functions google-cloud-firestore

1
推荐指数
1
解决办法
947
查看次数