--- title: Public resume tags: v1 --- # Public resume Table of Content [ToC] # 先備知識 ## MongoDB Collection: fio fio = app = S.M.A.R.T. Contract ## MongoDB Collection: alpha_admin 使用者帳號資料 ## MongoDB Collection: fio_xxx_manage_resume xxx 為 fio_id 管理每一筆資料公開與否,與其 resume_hash ## app-dashboard  ## public resume  ## api ``` api.get(/:fio_id/api/learning-curve-resume/:resume_hash) ``` # 簡易流程 資料庫中找符合 resume_hash 的每筆資料 (每一筆資料在被認證以後都該有一個 resume_hash,以便外部連進來時可透過此 resume_hash 查詢資料) 過濾掉被隱藏的資料 顯示在畫面上 # Schema 規劃 ## resume_hash 來源 render app-dashboard 時 md5(email+"FiO") 存進資料庫 alpha_admin.resume ``` alpha_admin.resume: { resume_hash, // string } fio_xxx_manage_resume[{ _id: 自動產生 obj_id: ID hide_for_publish: true/false, resume_hash: md5(email+"FiO") // email 為此 public resume 的主人 }] ``` ## 為每筆存入 resume_hash 時機 1. render app-dashboard 時 比對所有被 authenticated 的資料是否都有加上 resume_hash,沒有則加上 2. Admin authenticate 那筆資料時加上 ## Jack 疑慮 - 安全性疑慮: resume_hash 是否該存入 db ## Jack 提出作法 - 不存入 db, 每次都用 md5(email+'FiO')提供網址 , - 後端將 resume_hasha 反向解密 找符合該 email 和 fio_id 資料 ## md5(email+"FiO") 優點 - 只要是屬於此 user 的 resume_hash 值都會一樣,一個 user 只會有一個 resume_hash - resume_hash 為網址learning-curve-resume/後面一長串的字元加數字 - 可藉由此 resume_hash 找到不分 app 全部認證過的資料 - 未來可透過此 resume_hash 整合所有 app 認證過的資料 ## 改鹽巴作法 - /config.js 加入 resume_hash_salt 目前是("FiOF!@10") - resume_hash_salt 規則 - 包含特殊符號至少包含一個 "@" - 英文大小寫 - 數字 - 長度限制 8 ## Test script - 需要檢查有沒有此 config 變數 - resume_hash_salt
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up