Apicurio-studio: ν™˜κ²½ λ³€μˆ˜ "APICURIO_SHARE_FOR_EVERYONE"이 μΆ©λΆ„νžˆ μž‘λ™ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

에 λ§Œλ“  2019λ…„ 09μ›” 20일  Β·  3μ½”λ©˜νŠΈ  Β·  좜처: Apicurio/apicurio-studio

μ•ˆλ…•ν•˜μ„Έμš”!
var APICURIO_SHARE_FOR_EVERYONE ν™˜κ²½μ„ μ‹œλ„ν–ˆμŠ΅λ‹ˆλ‹€.
λ‹€λ₯Έ μ‚¬μš©μžμ˜ APIλ₯Ό 보고 νŽΈμ§‘ν•  수 μžˆμ§€λ§Œ " Collaborators " λ˜λŠ” " Mocks "λ₯Ό λ³Ό 수 μ—†μŠ΅λ‹ˆλ‹€.

원인을 κ²€μƒ‰ν•˜λ©΄ μ‚¬μš©μžμ—κ²Œ κΆŒν•œμ΄ μ—†κΈ° λ•Œλ¬Έμ— "getMocks" μ„œλΉ„μŠ€κ°€ "isShareForEveryone()" 속성을 ν™•μΈν•˜μ§€ μ•Šκ³  404 HTTP 였λ₯˜ 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): 약속 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): 약속 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(λ¬Έμžμ—΄ designId, μ •μˆ˜ μ‹œμž‘, μ •μˆ˜ 끝)
ServerError, NotFoundException λ°œμƒ {
μ •μˆ˜ = 0;
μ •μˆ˜ = 20;
if (μ‹œμž‘ != null) {
from = start.intValue();
}
if (끝 != 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);
    }
}

```

κ°€μž₯ μœ μš©ν•œ λŒ“κΈ€

μ•ˆλ…•ν•˜μ„Έμš”! κ·€ν•˜μ˜ μ˜κ²¬μ— κ°μ‚¬λ“œλ¦½λ‹ˆλ‹€. 버그λ₯Ό μ°Ύκ³  μžˆμ—ˆλŠ”λ°, μš°λ¦¬κ°€ 이전 버전을 μ‚¬μš©ν•˜κ³  μžˆλ‹€λŠ” 것을 μ•Œκ²Œ λ˜μ—ˆμŠ΅λ‹ˆλ‹€. 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. μžλ°”#L275

이 문제의 원인에 λŒ€ν•΄ λ‹€λ₯Έ 생각이 μžˆμŠ΅λ‹ˆκΉŒ?

μ•ˆλ…•ν•˜μ„Έμš”! κ·€ν•˜μ˜ μ˜κ²¬μ— κ°μ‚¬λ“œλ¦½λ‹ˆλ‹€. 버그λ₯Ό μ°Ύκ³  μžˆμ—ˆλŠ”λ°, μš°λ¦¬κ°€ 이전 버전을 μ‚¬μš©ν•˜κ³  μžˆλ‹€λŠ” 것을 μ•Œκ²Œ λ˜μ—ˆμŠ΅λ‹ˆλ‹€. 0.2.27.
λ―Έμ•ˆν•©λ‹ˆλ‹€.
앱을 μ—…λ°μ΄νŠΈν•˜κ² μŠ΅λ‹ˆλ‹€.
였λ₯˜λ₯Ό λ¬΄μ‹œν•  수 μžˆμŠ΅λ‹ˆλ‹€.

감사 ν•΄μš”.

이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰