Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need CreateCategory API ? #158

Open
godgunman opened this issue Mar 14, 2020 · 2 comments
Open

Need CreateCategory API ? #158

godgunman opened this issue Mar 14, 2020 · 2 comments

Comments

@godgunman
Copy link
Member

Do we need a category creation API? I thought we only allow users to add existing categories to articles for now.

Since we got some feedbacks from Flow, and we already added the ~4 additional categories. So I think we can have that API, and only use by team or AI model ?

@MrOrz
Copy link
Member

MrOrz commented Mar 14, 2020

I have one thing to add:
Should we allow website users inputting aiModel and aiConfidence in CreateArticleCategory?

I think in the resolver we should restrict the appId that can provide aiModel and aiConfidence.

We can have all our AIs under the same appId and give different userId to different AI models. The userId / appId is designed so that each different "app" can manage their own userId.

When AI scripts invoke CreateArticleCategory it will send secret key to API server, which API server recognizes in checkSecret and sets corresponding appId for resolvers to use. This is exactly how rumors-line-bot communicates with rumors-api, we can re-use the mechanism to achieve server-to-server communication between our API and the AIs.

@MrOrz
Copy link
Member

MrOrz commented Mar 18, 2020

3/18 結論

  1. CreateCategory: 蓋一個新的 util function 決定一個人是不是 admin (另外有個檔案?),非 admin 的人呼叫的話就 error
  2. CreateArticleCategorycheckSecret 認出新的 shared secret 並且設定 graphql context 的 appId。 不同 AI model 可以使用不同 query.userId,或使用不同 aiModel 欄位。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants