github.com/stripe/stripe-go/v76@v76.25.0/apps_secret.go (about) 1 // 2 // 3 // File generated from our OpenAPI spec 4 // 5 // 6 7 package stripe 8 9 // The secret scope type. 10 type AppsSecretScopeType string 11 12 // List of values that AppsSecretScopeType can take 13 const ( 14 AppsSecretScopeTypeAccount AppsSecretScopeType = "account" 15 AppsSecretScopeTypeUser AppsSecretScopeType = "user" 16 ) 17 18 // Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. 19 type AppsSecretListScopeParams struct { 20 // The secret scope type. 21 Type *string `form:"type"` 22 // The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. 23 User *string `form:"user"` 24 } 25 26 // List all secrets stored on the given scope. 27 type AppsSecretListParams struct { 28 ListParams `form:"*"` 29 // Specifies which fields in the response should be expanded. 30 Expand []*string `form:"expand"` 31 // Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. 32 Scope *AppsSecretListScopeParams `form:"scope"` 33 } 34 35 // AddExpand appends a new field to expand. 36 func (p *AppsSecretListParams) AddExpand(f string) { 37 p.Expand = append(p.Expand, &f) 38 } 39 40 // Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. 41 type AppsSecretScopeParams struct { 42 // The secret scope type. 43 Type *string `form:"type"` 44 // The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. 45 User *string `form:"user"` 46 } 47 48 // Create or replace a secret in the secret store. 49 type AppsSecretParams struct { 50 Params `form:"*"` 51 // Specifies which fields in the response should be expanded. 52 Expand []*string `form:"expand"` 53 // The Unix timestamp for the expiry time of the secret, after which the secret deletes. 54 ExpiresAt *int64 `form:"expires_at"` 55 // A name for the secret that's unique within the scope. 56 Name *string `form:"name"` 57 // The plaintext secret value to be stored. 58 Payload *string `form:"payload"` 59 // Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. 60 Scope *AppsSecretScopeParams `form:"scope"` 61 } 62 63 // AddExpand appends a new field to expand. 64 func (p *AppsSecretParams) AddExpand(f string) { 65 p.Expand = append(p.Expand, &f) 66 } 67 68 // Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. 69 type AppsSecretFindScopeParams struct { 70 // The secret scope type. 71 Type *string `form:"type"` 72 // The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. 73 User *string `form:"user"` 74 } 75 76 // Finds a secret in the secret store by name and scope. 77 type AppsSecretFindParams struct { 78 Params `form:"*"` 79 // Specifies which fields in the response should be expanded. 80 Expand []*string `form:"expand"` 81 // A name for the secret that's unique within the scope. 82 Name *string `form:"name"` 83 // Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. 84 Scope *AppsSecretFindScopeParams `form:"scope"` 85 } 86 87 // AddExpand appends a new field to expand. 88 func (p *AppsSecretFindParams) AddExpand(f string) { 89 p.Expand = append(p.Expand, &f) 90 } 91 92 // Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. 93 type AppsSecretDeleteWhereScopeParams struct { 94 // The secret scope type. 95 Type *string `form:"type"` 96 // The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. 97 User *string `form:"user"` 98 } 99 100 // Deletes a secret from the secret store by name and scope. 101 type AppsSecretDeleteWhereParams struct { 102 Params `form:"*"` 103 // Specifies which fields in the response should be expanded. 104 Expand []*string `form:"expand"` 105 // A name for the secret that's unique within the scope. 106 Name *string `form:"name"` 107 // Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. 108 Scope *AppsSecretDeleteWhereScopeParams `form:"scope"` 109 } 110 111 // AddExpand appends a new field to expand. 112 func (p *AppsSecretDeleteWhereParams) AddExpand(f string) { 113 p.Expand = append(p.Expand, &f) 114 } 115 116 type AppsSecretScope struct { 117 // The secret scope type. 118 Type AppsSecretScopeType `json:"type"` 119 // The user ID, if type is set to "user" 120 User string `json:"user"` 121 } 122 123 // Secret Store is an API that allows Stripe Apps developers to securely persist secrets for use by UI Extensions and app backends. 124 // 125 // 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. 126 // 127 // 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. 128 // 129 // 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. 130 // 131 // Related guide: [Store data between page reloads](https://stripe.com/docs/stripe-apps/store-auth-data-custom-objects) 132 type AppsSecret struct { 133 APIResource 134 // Time at which the object was created. Measured in seconds since the Unix epoch. 135 Created int64 `json:"created"` 136 // If true, indicates that this secret has been deleted 137 Deleted bool `json:"deleted"` 138 // The Unix timestamp for the expiry time of the secret, after which the secret deletes. 139 ExpiresAt int64 `json:"expires_at"` 140 // Unique identifier for the object. 141 ID string `json:"id"` 142 // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. 143 Livemode bool `json:"livemode"` 144 // A name for the secret that's unique within the scope. 145 Name string `json:"name"` 146 // String representing the object's type. Objects of the same type share the same value. 147 Object string `json:"object"` 148 // The plaintext secret value to be stored. 149 Payload string `json:"payload"` 150 Scope *AppsSecretScope `json:"scope"` 151 } 152 153 // AppsSecretList is a list of Secrets as retrieved from a list endpoint. 154 type AppsSecretList struct { 155 APIResource 156 ListMeta 157 Data []*AppsSecret `json:"data"` 158 }