2016-05-13 4 views
0

/loginなどのいくつかのエンドポイントを除いて、access_tokenクエリパラメータを受け入れるようにAPIを設計しました。このようなRAMLルールを書く方法はありますか?いくつかのルートを除くRAMLグローバルクエリパラメータ

/login: 
    description: hello world 
    post: 
/hello: 
    description: hello world 
    get: 
    queryParameters: 
     access_token: 
/world: 
    description: hello world 
    get: 
    queryParameters: 
     access_token: 

答えて

0

これには特性を使用できます。例

traits: 
    - withAccessToken: 
    queryParameters: 
     access_token: 
/login: 
    description: hello world 
    post: 
/hello: 
    description: hello world 
    get: 
    is: [withAccessToken] 
/world: 
    description: hello world 
    get: 
    is: [withAccessToken] 

しかし、access_tokenのクエリを使用するのはセキュリティではありません。このためにヘッダーを使用する方が効果的です。

関連する問題