Apicurio-studio: 環境変数「APICURIO_SHARE_FOR_EVERYONE」が十分に機能しません

作成日 2019年09月20日  ·  3コメント  ·  ソース: Apicurio/apicurio-studio

やあ!
私は環境変数APICURIO_SHARE_FOR_EVERYONEを試していました
他のユーザーのAPIを表示および編集できますが、「コラボレーター」または「モック」が表示されません。

原因を検索したところ、ユーザーに権限がないため、サービス「getMocks」がプロパティ「isShareForEveryone()」をチェックせず、404HTTPエラーSatusを返すことがわかりました。 「コラボレーター」セクションについても同じです。

ApicurioError

https://github.com/Apicurio/apicurio-studio/blob/master/front-end/studio/src/app/services/apis.service.ts

this.endpoint( "/ designs /:designId / mocks"、

`` `

public getMocks(apiId:string、from?:number、to?:number):Promise console.info( "[ApisService] API%sのすべてのモックを取得しています"、apiId);

    let getMocksUrl: string = this.endpoint("/designs/:designId/mocks", {
        designId: apiId
    }, {
        start: from,
        end: to
    });

    let options: any = this.options({ "Accept": "application/json" });

    console.info("[ApisService] Fetching API mocks: %s", getMocksUrl);
    return this.httpGet<ApiMock[]>(getMocksUrl, options);
}

> this.endpoint("/designs/:designId/collaborators",

public getCollaborators(apiId:string):Promise console.info( "[ApisService] APIデザイン%sのコラボレーターを取得しています"、apiId);

    let getCollaboratorsUrl: string = this.endpoint("/designs/:designId/collaborators", {
        designId: apiId
    });
    let options: any = this.options({ "Accept": "application/json" });

    console.info("[ApisService] Fetching collaborator list: %s", getCollaboratorsUrl);
    return this.httpGet<ApiCollaborator[]>(getCollaboratorsUrl, options);
}

**https://github.com/Apicurio/apicurio-studio/blob/master/back-end/hub-api/src/main/java/io/apicurio/hub/api/rest/impl/DesignsResource.java**

> !this.storage.hasWritePermission

@オーバーライド
パブリックコレクションgetMocks(String designId、Integer start、Integer end)
ServerError、NotFoundExceptionをスローします{
int from = 0;
int to = 20;
if(start!= null){
from = start.intValue();
}
if(end!= null){
to = end.intValue();
}

    try {
        String user = this.security.getCurrentUser().getLogin();
        if (!this.storage.hasWritePermission(user, designId)) {
            throw new NotFoundException();
        }
        return this.storage.listApiDesignMocks(designId, from, to);
    } catch (StorageException e) {
        throw new ServerError(e);
    }
}

@オーバーライド
パブリックコレクションgetCollaborators(String designId)はServerError、NotFoundException {をスローします
logger.debug( "APIのすべてのコラボレーターを取得しています:{}"、designId);
metrics.apiCall( "/ designs / {designId} / collaborators"、 "GET");

    try {
        String user = this.security.getCurrentUser().getLogin();
        if (!this.storage.hasWritePermission(user, designId)) {
            throw new NotFoundException();
        }
        return this.storage.listPermissions(designId);
    } catch (StorageException e) {
        throw new ServerError(e);
    }
}

`` `

bug

最も参考になるコメント

やあ! コメントありがとうございます。バグを探していますが、古いバージョンを使用していたことがわかりました。 0.2.27。
申し訳ありません。
アプリを更新します。
エラーを閉じることができます。

ありがとう。

全てのコメント3件

バグレポートをありがとう。

@AguRyan最新のリリースでは、 hasWritePermission()関数内で、 isShareForEveryone()がチェックされていることがわかりました。

https://github.com/Apicurio/apicurio-studio/blob/v0.2.43.Final/back-end/hub-core/src/main/java/io/apicurio/hub/core/storage/jdbc/JdbcStorage。 java#L275

この問題の原因について他に何か考えがありますか?

やあ! コメントありがとうございます。バグを探していますが、古いバージョンを使用していたことがわかりました。 0.2.27。
申し訳ありません。
アプリを更新します。
エラーを閉じることができます。

ありがとう。

このページは役に立ちましたか?
0 / 5 - 0 評価