2

This has been asked in similar forms here and here but it seems pretty important, and the framework is under rapid development, so I'm going to raise it again:

Assuming your login page needs to face the public internet, how do you prevent Meteor from sending all of the authenticated user templates to a non-authenticated client?

Example use case: You have some really unique analytics / performance indicators that you want to keep secret. You've built templates to visualize each one. Simply by visiting the login page, Meteor will send any rando the templates which, even unpopulated, disclose a ton of proprietary information.

I've seen two suggestions:

  1. Break admin into a separate app. This doesn't address the issue assuming admin login faces the public internet, unless I'm missing something.
  2. Put the templates in the public folder or equivalent and load them dynamically. This doesn't help either, since the file names will be visible from other templates which will be sent to the client.

The only thing I can think of is to store the template strings in the server folder and have the client call a Meteor.method after login to retrieve and render them. And if you want them to behave like normal client templates, you'd have to muck around with the internal API (e.g., Meteor._def_template).

Is there any more elegant way to do this?

4

2 に答える 2

0

これら 2 つのパッケージは、この問題に対処しようとしています:
https://atmospherejs.com/numtel/publicsources
https://atmospherejs.com/numtel/privatesources

Iron-router プラグインを使用して、特定のファイルをすべてのルートにロードします。

ここで見られる主な欠点は、保護されたファイルを/publicまたは/privateフォルダーに保存する必要があるため、アプリの構造を変更する必要があることです。
また、iron-router を使用することになっています。

于 2015-05-23T14:26:24.693 に答える
0

ここで同様の質問をしました: セグメント化されたMeteor アプリ - クライアントの半分のみをロードするか、データベースを共有する 2 つのアプリをロードします。

共通の懸念事項のようであり、いつか対処する必要があることは確かだと思います。

それまでは、より小さな「パブリック」アプリを作成し、DB を管理アプリと共有することを計画しています (管理者のサイズ/データに応じて、おそらく Meteor で、おそらく他の何かで)。

于 2013-03-29T20:05:28.840 に答える