앱 사양 개요¶
This topic describes how a provider can configure a Snowflake Native App to use app specifications to request controlled access from consumers. App specifications allow consumers to review and approve or decline requests for the following actions:
Snowflake 외부의 외부 엔드포인트에 대한 연결
서드 파티 서비스를 사용한 인증
기타 Snowflake 계정과의 데이터 공유
|native-apps|에 대한 제어된 액세스 유형¶
|native-apps|는 컨슈머의 Snowflake 계정 이외의 리소스와 상호 작용해야 하는 경우가 많습니다. 이러한 상호 작용에는 외부 서비스 연결, 서드 파티 공급자와의 인증 또는 다른 Snowflake 계정과의 데이터 공유가 포함될 수 있습니다.
To access external services and share data, Snowflake provides the following objects:
- 외부 액세스 통합:
사용자 정의 함수 또는 저장 프로시저 내에서 외부 네트워크 엔드포인트에 대한 보안 액세스를 허용합니다. 외부 액세스 통합은 네트워크 규칙을 사용하여 특정 외부 네트워크 위치에 대한 액세스를 제한합니다.
- 보안 통합:
OAuth와 같은 서드 파티 인증 공급자에 대한 보안 액세스를 허용합니다. 보안 통합은 보안 인증 및 액세스 제어를 제공합니다.
- 공유 및 목록:
앱이 공급자 또는 서드 파티 Snowflake 계정과 데이터를 다시 공유하도록 허용합니다. 공유에는 공유할 데이터베이스 오브젝트가 포함되어 있으며, 목록은 계정과 리전 간에 데이터를 공유하는 메커니즘을 제공합니다.
When using automated granting of privileges, an app has the required privileges to create these objects when running the setup script. However, because these objects enable external connections or data sharing, consumers must approve these operations when configuring the app.
앱 사양과 함께 자동 권한 부여를 사용하면 다음과 같은 이점이 있습니다.
Consumers do not have to manually create integrations, shares, or listings required by the app and approve access to them using references.
공급자는 설치 또는 업그레이드 중에 필요한 권한과 오브젝트가 있는지 확인하는 코드를 작성할 필요가 없습니다.
컨슈머는 외부 연결 및 데이터 공유 요청을 명확하게 파악하고 제어할 수 있습니다.
Use app specifications for consumer approval¶
App specifications allow you to specify what controlled access the app requires. After the consumer installs the app, they review the app specification and approve or decline each request as necessary. This includes requests for external connections, authentication integrations, and data sharing permissions.
For information about using app specifications to request access to external endpoint access, see 외부 액세스 통합(EAIs) 요청(앱 사양 포함).
For information about using app specifications to request access to OAuth integrations, see 앱 사양으로 보안 통합 요청하기.
앱 사양을 사용하여 목록을 통해 데이터를 공유하는 방법에 대한 자세한 내용은 앱 사양으로 데이터 공유 요청 섹션을 참조하세요.
앱 사양 정의¶
An app specification definition contains the properties that are required for the app to perform controlled operations such as external connections or data sharing. These properties are displayed to the consumer for approval. The app specification definition contains a subset of the metadata and properties specific to each type of operation: external access integration, security integration, or listing.
보안 통합을 위한 앱 사양 정의에 대한 자세한 내용은 보안 통합을 위한 앱 사양 정의 섹션을 참조하세요.
외부 액세스 통합을 위한 앱 사양 정의에 대한 자세한 내용은 App specification definition for an EAI 섹션을 참조하세요.
For information about the app specification definition for listings, see 목록에 대한 앱 사양 만들기.
Sequence numbers of an app specification¶
시퀀스 번호는 앱 사양의 버전 번호와 유사합니다. 시퀀스 번호는 공급자가 앱 사양의 정의를 변경할 때 자동으로 증가합니다. 앱 사양 정의에는 구성 세부사항 및 기타 필수 정보가 포함됩니다. 정의에 포함되지 않은 필드(예: description)는 시퀀스 번호 업데이트를 트리거하지 않습니다.
공급자와 컨슈머는 시퀀스 번호를 통해 앱 사양의 다양한 버전을 식별할 수 있습니다. 예를 들어 공급자가 앱 사양 정의에 새 구성 세부 정보를 추가하면 시퀀스 번호가 증가합니다. 컨슈머는 앱 사양을 볼 때 시퀀스 번호가 변경되었음을 확인하고 업데이트된 앱 사양을 검토할 수 있습니다.
앱 사양 사용 시 모범 사례¶
Automated granting of privileges ensures that the app has the required privileges to create objects like external access integrations, security integrations, or listings. However, consumers can choose to decline the app specification that enables external connections or data sharing. When developing an app, you must account for situations where app specifications might not be approved.
다음 시나리오를 생각해 보세요.
An app might request multiple network ports for an external access integration, but the consumer might allow only one. The app should include logic to handle errors that occur if a network port is not available.
일부 대상 계정에 대해서만 데이터 공유 요청을 거부하거나 부분적으로만 승인할 수 있습니다. 앱은 이러한 사례를 정상적으로 처리해야 합니다.
인증 통합이 거부되어 앱이 대체 방법을 사용해야 할 수 있습니다.
항상 적절한 오류 처리를 포함하고, 작동을 위해 승인된 사양이 필요한 기능에 대한 명확한 피드백을 컨슈머에게 제공하는 것이 모범 사례입니다.
앱 사양과 함께 콜백 함수 사용¶
In some contexts, an app might need to know when the consumer has approved or declined an app specification. For example:
앱은 API 호출 전에 외부 액세스 사양이 승인될 때까지 기다려야 할 수 있습니다.
데이터 채우기는 목록 사양이 승인된 후에만 시작해야 할 수도 있습니다.
보안 통합 승인 후 OAuth 흐름을 초기화해야 할 수 있습니다.
이러한 상황을 처리하기 위해, |naf|는 공급자가 앱 사양을 승인하거나 거부할 때 실행되는 콜백 저장 프로시저를 정의할 수 있는 메커니즘을 제공합니다.
공급자는 다음 예제시와 같이 매니페스트 파일에 저장 프로시저를 추가할 수 있습니다.
lifecycle_callbacks:
specification_action: callbacks.on_spec_update
This example shows how to add a stored procedure named callbacks.on_spec_update to the manifest
file. In the setup script, providers can add a stored procedure as shown in
the following example:
CREATE OR REPLACE PROCEDURE callbacks.on_spec_update (
name STRING,
status STRING,
payload STRING)
...
This example shows the signature of a stored procedure called callbacks.on_spec_update.
You include the code in the body of this procedure to check the status of the app specification, create objects, and perform actions as required.