Coder Social home page Coder Social logo

fed's Introduction

Hi there 👋

🔭 I’m currently working on holo language!

Languages

TypeScript, C#, C/C++

Interest

  • Programming language processing
  • Server federation
  • Desktop apps

Links

fed's People

Contributors

marihachi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fed's Issues

キャッシュの更新を見直す

  • POSTでキャッシュの作成イベント
  • PUTでキャッシュの更新イベント

というのをやめる。

POSTで更新イベントを表すようにする。
キャッシュには元データがあるので、全て更新という扱いで問題無さそう。

PUTを使ってもいいが、無駄にリソースのIDを指定することを避けたい。
送信されたリソース自体にもIDを持っていながらURLパスにもIDを持つ必要はなさそう。

構成検討

仕様

  • JSONスキーマ定義: JSON Schema Draft-07
  • JSONスキーマ検証: ajv
  • 署名: http-signature (Signing HTTP Messages)
  • リクエストを受理する時はホスト名を検証しなければならない
  • 細かくサーバの能力を定義できる

構造

bodyはJSON

用語

  • サービス
  • コンポーネント

参考

JSON Schema
https://qiita.com/meta_closure/items/edc0abc704f9ade37cc5
https://blog.wktk.co.jp/ja/entry/2016/01/19/json-schema-draft-v4

  • ActivityPub
  • BLE
  • USB

サービス (機能)

  • マイクロブログ
  • ギャラリー
  • ゲーム
  • グループ
  • チャンネル

RESTful APIベースのサーバー連合

サーバー間の連合でも、普通のAPIのようにRESTful APIとしてやり取りするのがシンプルで良さそう。

連合用のエンドポイント

サーバーは連合用のパス/federation/resource/を持つ。
この下に、連合用の各種リソースのエンドポイントを持つ。

リソースの取得とキャッシュ

サーバーは、リモートサーバーのリソースが必要になるとGETアクセスで取得する。
取得したリソースはキャッシュとして保存できる。キャッシュには有効期限を設けるべきである。
リソースのキャッシュがある場合は、リソースの取得を行わずに再利用できる。

イベントキュー

リソースに変更があった場合、イベントが発行されることがある。
エンドポイント /federation/queueで配信される。

TODO: イベント購読

  • リソースの削除
    このイベントを受け取った場合は、そのリソースのキャッシュを破棄する。

サーバーの識別・認証

識別と認証

サーバーは関連付けられた1つのURL(ホスト名?)を持っていて、他のサーバーはこのURLに対して通信を行う。
トークン認証でサーバーの同一性を確認する。
サーバーのURLはそのサーバーへのリンクとして機能するが識別するためのものではない。そのURLは必要に応じて変更することができる(認証トークンがある場合)。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.