/
secret.py
42 lines (32 loc) · 1.78 KB
/
secret.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from __future__ import absolute_import, division, print_function
from stripe.api_resources.abstract import CreateableAPIResource
from stripe.api_resources.abstract import ListableAPIResource
class Secret(CreateableAPIResource, ListableAPIResource):
"""
Secret Store is an API that allows Stripe Apps developers to securely persist secrets for use by UI Extensions and app backends.
The primary resource in Secret Store is a `secret`. Other apps can't view secrets created by an app. Additionally, secrets are scoped to provide further permission control.
All Dashboard users and the app backend share `account` scoped secrets. Use the `account` scope for secrets that don't change per-user, like a third-party API key.
A `user` scoped secret is accessible by the app backend and one specific Dashboard user. Use the `user` scope for per-user secrets like per-user OAuth tokens, where different users might have different permissions.
Related guide: [Store data between page reloads](https://stripe.com/docs/stripe-apps/store-auth-data-custom-objects).
"""
OBJECT_NAME = "apps.secret"
@classmethod
def delete_where(
cls,
api_key=None,
stripe_version=None,
stripe_account=None,
**params
):
return cls._static_request("post", "/v1/apps/secrets/delete", api_key=api_key, stripe_version=stripe_version, stripe_account=stripe_account, params=params)
@classmethod
def find(
cls,
api_key=None,
stripe_version=None,
stripe_account=None,
**params
):
return cls._static_request("get", "/v1/apps/secrets/find", api_key=api_key, stripe_version=stripe_version, stripe_account=stripe_account, params=params)