Endpoint Secrets

Un segreto è una risorsa che esiste solo all'interno delle proprietà di inoltro degli eventi (proprietà con un attributo platform impostato su edge). Consentono l’inoltro degli eventi per l’autenticazione in un altro sistema per lo scambio sicuro dei dati.

Questa guida illustra come effettuare chiamate all'endpoint /secrets nell'API di Reactor. Per una spiegazione dettagliata dei diversi tipi di segreto e di come utilizzarli, consulta la panoramica di alto livello su segreti prima di tornare a questa guida.

Introduzione

L’endpoint utilizzato in questa guida fa parte dell’API di Reactor. Prima di continuare, consulta la guida introduttiva per informazioni importanti su come eseguire l’autenticazione nell’API.

Recuperare un elenco di segreti per una proprietà list-property

Per elencare i segreti che appartengono a una proprietà, devi eseguire una richiesta GET.

Formato API

GET /properties/{PROPERTY_ID}/secrets
Parametro
Descrizione
{PROPERTY_ID}
ID della proprietà di cui desideri elencare i segreti.

Richiesta

curl -X GET \
  https://reactor.adobe.io/properties/PRe005d921bb724bc88c3ff28e3e916f04/secrets \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {ORG_ID}' \
  -H 'Accept: application/vnd.api+json;revision=1' \
  -H 'Content-Type: application/vnd.api+json'

Risposta

In caso di esito positivo, la risposta restituisce un elenco di segreti appartenenti alla proprietà.

{
  "data": [
    {
      "id": "SE8bd20bd5d16b49ee9d925929e292526c",
      "type": "secrets",
      "attributes": {
        "created_at": "2021-07-16T22:29:29.777Z",
        "updated_at": "2021-07-16T22:29:29.777Z",
        "name": "Example Secret",
        "type_of": "token",
        "activated_at": null,
        "expires_at": null,
        "refresh_at": null,
        "status": "pending",
        "credentials": {
        }
      },
      "relationships": {
        "property": {
          "links": {
            "related": "https://reactor.adobe.io/secrets/SE8bd20bd5d16b49ee9d925929e292526c/property"
          },
          "data": {
            "id": "PRe005d921bb724bc88c3ff28e3e916f04",
            "type": "properties"
          }
        },
        "environment": {
          "links": {
            "related": "https://reactor.adobe.io/secrets/SE8bd20bd5d16b49ee9d925929e292526c/environment"
          },
          "data": {
            "id": "EN80ad9efbf4ff4f15bebd770613378a75",
            "type": "environments"
          },
          "meta": {
            "stage": "development"
          }
        },
        "notes": {
          "links": {
            "related": "https://reactor.adobe.io/secrets/SE8bd20bd5d16b49ee9d925929e292526c/notes"
          }
        }
      },
      "links": {
        "self": "https://reactor.adobe.io/secrets/SE8bd20bd5d16b49ee9d925929e292526c",
        "property": "https://reactor.adobe.io/secrets/SE8bd20bd5d16b49ee9d925929e292526c/property"
      }
    }
  ],
  "meta": {
    "pagination": {
      "current_page": 1,
      "next_page": null,
      "prev_page": null,
      "total_pages": 1,
      "total_count": 1
    }
  }
}

Recuperare un elenco di segreti per un ambiente list-environment

Per elencare i segreti appartenenti a un ambiente, devi eseguire una richiesta GET.

Formato API

GET /environments/{ENVIRONMENT_ID}/secrets
Parametro
Descrizione
{ENVIRONMENT_ID}
ID dell’ambiente di cui desideri elencare i segreti.

Richiesta

curl -X GET \
  https://reactor.adobe.io/environments/EN0a1b00749daf4ff48a34d2ec37286aa7/secrets \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {ORG_ID}' \
  -H 'Accept: application/vnd.api+json;revision=1' \
  -H 'Content-Type: application/vnd.api+json'

Risposta

In caso di esito positivo, la risposta restituisce un elenco di segreti appartenenti all’ambiente.

{
  "data": [
    {
      "id": "SE57b5ea69acde4595825b85befd1675b3",
      "type": "secrets",
      "attributes": {
        "created_at": "2021-07-16T22:29:35.447Z",
        "updated_at": "2021-07-16T22:29:35.447Z",
        "name": "Example Secret",
        "type_of": "token",
        "activated_at": null,
        "expires_at": null,
        "refresh_at": null,
        "status": "pending",
        "credentials": {
        }
      },
      "relationships": {
        "property": {
          "links": {
            "related": "https://reactor.adobe.io/secrets/SE57b5ea69acde4595825b85befd1675b3/property"
          },
          "data": {
            "id": "PRb302ca3557334c13b130da719222ec97",
            "type": "properties"
          }
        },
        "environment": {
          "links": {
            "related": "https://reactor.adobe.io/secrets/SE57b5ea69acde4595825b85befd1675b3/environment"
          },
          "data": {
            "id": "EN0a1b00749daf4ff48a34d2ec37286aa7",
            "type": "environments"
          },
          "meta": {
            "stage": "development"
          }
        },
        "notes": {
          "links": {
            "related": "https://reactor.adobe.io/secrets/SE57b5ea69acde4595825b85befd1675b3/notes"
          }
        }
      },
      "links": {
        "self": "https://reactor.adobe.io/secrets/SE57b5ea69acde4595825b85befd1675b3",
        "property": "https://reactor.adobe.io/secrets/SE57b5ea69acde4595825b85befd1675b3/property"
      }
    }
  ],
  "meta": {
    "pagination": {
      "current_page": 1,
      "next_page": null,
      "prev_page": null,
      "total_pages": 1,
      "total_count": 1
    }
  }
}

Cercare un segreto lookup

Per cercare un segreto, devi includere il relativo ID nel percorso di una richiesta GET.

Formato API

GET /secrets/{SECRET_ID}
Parametro
Descrizione
{SECRET_ID}
ID del segreto che desideri cercare.

Richiesta

curl -X GET \
  https://reactor.adobe.io/secrets/SEa3756b962e964fadb61e31df1f7dd5a3 \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {ORG_ID}' \
  -H 'Accept: application/vnd.api+json;revision=1' \
  -H 'Content-Type: application/vnd.api+json'

Risposta

In caso di esito positivo, la risposta restituisce i dettagli del segreto.

{
  "data": {
    "id": "SEa3756b962e964fadb61e31df1f7dd5a3",
    "type": "secrets",
    "attributes": {
      "created_at": "2021-07-16T22:29:41.135Z",
      "updated_at": "2021-07-16T22:29:41.135Z",
      "name": "Example Secret",
      "type_of": "token",
      "activated_at": null,
      "expires_at": null,
      "refresh_at": null,
      "status": "pending",
      "credentials": {
        }
    },
    "relationships": {
      "property": {
        "links": {
          "related": "https://reactor.adobe.io/secrets/SEa3756b962e964fadb61e31df1f7dd5a3/property"
        },
        "data": {
          "id": "PR19717d5acf114209a5aebd0f2b228438",
          "type": "properties"
        }
      },
      "environment": {
        "links": {
          "related": "https://reactor.adobe.io/secrets/SEa3756b962e964fadb61e31df1f7dd5a3/environment"
        },
        "data": {
          "id": "EN04d820606cc74d5eaf51616e8b50201a",
          "type": "environments"
        },
        "meta": {
          "stage": "development"
        }
      },
      "notes": {
        "links": {
          "related": "https://reactor.adobe.io/secrets/SEa3756b962e964fadb61e31df1f7dd5a3/notes"
        }
      }
    },
    "links": {
      "self": "https://reactor.adobe.io/secrets/SEa3756b962e964fadb61e31df1f7dd5a3",
      "property": "https://reactor.adobe.io/secrets/SEa3756b962e964fadb61e31df1f7dd5a3/property"
    }
  }
}

Creare un segreto create

Per creare un segreto, devi eseguire una richiesta POST.

NOTE
Quando crei un nuovo segreto, l’API restituisce una risposta immediata contenente informazioni per tale risorsa. Allo stesso tempo, viene attivata un'attività di scambio segreto per verificare che lo scambio di credenziali funzioni. Questa attività viene elaborata in modo asincrono e aggiorna l'attributo di stato del segreto su succeeded o failed a seconda del risultato.

Formato API

POST /properties/{PROPERTY_ID}/secrets
Parametro
Descrizione
{PROPERTY_ID}
ID della proprietà in cui desideri definire il segreto.

Richiesta

curl -X POST \
  https://reactor.adobe.io/properties/PR9eff664dc6014217b76939bb78b83976/secrets \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {ORG_ID}' \
  -H 'Accept: application/vnd.api+json;revision=1' \
  -H 'Content-Type: application/vnd.api+json' \
  -d '{
        "data": {
          "attributes": {
            "name": "Example Secret",
            "type_of": "simple-http",
            "credentials": {
              "username": "example_username",
              "password": "pass12345"
            }
          },
          "relationships": {
            "environment": {
              "data": {
                "id": "EN04cdddbdb6574170bcac9f470f3b8087",
                "type": "environments"
              }
            }
          },
          "type": "secrets"
        }
      }'
Proprietà
Descrizione
name
Nome univoco e descrittivo del segreto.
type_of

Tipo di credenziali di autenticazione rappresentato dal segreto. Ha tre valori accettati:

  • token: una stringa di token.
  • simple-http: nome utente e password.
  • oauth2: credenziali conformi allo standard OAuth.
credentials
Oggetto contenente i valori delle credenziali per il segreto. A seconda dell'attributo type_of, è necessario specificare proprietà diverse. Per informazioni dettagliate sui requisiti per ciascun tipo, consulta la sezione sulle credenziali nella guida dei segreti.
relationships.environment
Ogni segreto deve essere associato a un ambiente quando viene creato per la prima volta. L'oggetto data all'interno di questa proprietà deve contenere id dell'ambiente a cui viene assegnato il segreto, insieme a un valore type di environments.
type
Tipo di risorsa da creare. Per questa chiamata, il valore deve essere secrets.

Risposta

In caso di esito positivo, la risposta restituisce i dettagli del segreto. A seconda del tipo di segreto, alcune proprietà in credentials potrebbero essere nascoste.

{
  "data": {
    "id": "SE39fdf431f8ad4600bbc24ea73fcb1154",
    "type": "secrets",
    "attributes": {
    "created_at": "2021-07-14T19:33:25.628Z",
    "updated_at": "2021-07-14T19:33:25.628Z",
    "name": "Example Secret",
    "type_of": "simple-http",
    "activated_at": null,
    "expires_at": null,
    "refresh_at": null,
    "status": "pending",
    "credentials": {
      "username": "example_username"
      }
    },
    "relationships": {
      "property": {
        "links": {
          "related": "https://reactor.adobe.io/secrets/SE39fdf431f8ad4600bbc24ea73fcb1154/property"
        },
        "data": {
          "id": "PR9eff664dc6014217b76939bb78b83976",
          "type": "properties"
        }
      },
      "environment": {
        "links": {
          "related": "https://reactor.adobe.io/secrets/SE39fdf431f8ad4600bbc24ea73fcb1154/environment"
        },
        "data": {
          "id": "EN04cdddbdb6574170bcac9f470f3b8087",
          "type": "environments"
        },
        "meta": {
          "stage": "development"
        }
      },
      "notes": {
        "links": {
          "related": "https://reactor.adobe.io/secrets/SE39fdf431f8ad4600bbc24ea73fcb1154/notes"
        }
      }
    },
    "links": {
      "self": "https://reactor.adobe.io/secrets/SE39fdf431f8ad4600bbc24ea73fcb1154",
      "property": "https://reactor.adobe.io/secrets/SE39fdf431f8ad4600bbc24ea73fcb1154/property"
    }
  }
}

Verifica un segreto oauth2 test

NOTE
Questa operazione può essere eseguita solo su segreti con un valore type_of di oauth2.

È possibile verificare un segreto oauth2 includendo il relativo ID nel percorso di una richiesta PATCH. L'operazione di test esegue uno scambio e include la risposta del servizio di autorizzazione nell'attributo test_exchange nell'oggetto meta del segreto. Questa operazione non aggiorna il segreto stesso.

Formato API

PATCH /secrets/{SECRET_ID}
Parametro
Descrizione
{SECRET_ID}
ID del segreto oauth2 che si desidera verificare.

Richiesta

curl -X PATCH \
  https://reactor.adobe.io/secrets/SE6c15a7a64f9041b5985558ed3e19a449 \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {ORG_ID}' \
  -H 'Accept: application/vnd.api+json;revision=1' \
  -H 'Content-Type: application/vnd.api+json' \
  -d '{
        "data": {
          "attributes": {
            "type_of": "oauth2"
          },
          "meta": {
            "action": "test"
          },
          "id": "SE6c15a7a64f9041b5985558ed3e19a449",
          "type": "secrets"
        }
      }'
Proprietà
Descrizione
attributes
Deve contenere una proprietà type_of con valore oauth2.
meta
Deve contenere una proprietà action con valore test.
id
ID del segreto che stai testando. Deve corrispondere all’ID fornito nel percorso della richiesta.
type
Tipo di risorsa su cui viene eseguita l’operazione. Deve essere impostato su secrets.

Risposta

In caso di esito positivo, la risposta restituisce i dettagli del segreto. La risposta del servizio di autorizzazione è contenuta in meta.test_exchange.

{
  "data": {
    "id": "SE6c15a7a64f9041b5985558ed3e19a449",
    "type": "secrets",
    "attributes": {
      "activated_at": null,
      "created_at": "2021-07-14T19:33:25.628Z",
      "credentials": {
        "token_url": "https://token_url.test/token/authorize?required_param=value",
        "client_id": "test_client_id",
        "client_secret": "test_client_secret",
        "refresh_offset": 14400,
      },
      "expires_at": null,
      "name": "Example Secret",
      "refresh_at": null,
      "status": "pending",
      "type_of": "oauth2",
      "updated_at": "2021-07-14T19:33:25.628Z",
    },
    "relationships": {
      "property": {
        "links": {
          "related": "https://reactor.adobe.io/secrets/SE39fdf431f8ad4600bbc24ea73fcb1154/property"
        },
        "data": {
          "id": "PR9eff664dc6014217b76939bb78b83976",
          "type": "properties"
        }
      },
      "environment": {
        "links": {
          "related": "https://reactor.adobe.io/secrets/SE39fdf431f8ad4600bbc24ea73fcb1154/environment"
        },
        "data": {
          "id": "EN04cdddbdb6574170bcac9f470f3b8087",
          "type": "environments"
        },
        "meta": {
          "stage": "development"
        }
      },
      "notes": {
        "links": {
          "related": "https://reactor.adobe.io/secrets/SE39fdf431f8ad4600bbc24ea73fcb1154/notes"
        }
      }
    },
    "links": {
      "self": "https://reactor.adobe.io/secrets/SE39fdf431f8ad4600bbc24ea73fcb1154",
      "property": "https://reactor.adobe.io/secrets/SE39fdf431f8ad4600bbc24ea73fcb1154/property"
    },
    "meta": {
      "test_exchange": {
        "access_token": "FpIkBn3zxW0fH6EBC4MB",
        "expires_in": 36000,
        "token_type": "Bearer",
      }
    }
  }
}

Riprova un segreto retry

Il nuovo tentativo di un segreto comporta l'attivazione manuale dello scambio segreto. Per riprovare un segreto, devi includere il relativo ID nel percorso di una richiesta PATCH.

Formato API

PATCH /secrets/{SECRET_ID}
Parametro
Descrizione
{SECRET_ID}
ID del segreto che si desidera ritentare.

Richiesta

curl -X PATCH \
  https://reactor.adobe.io/secrets/SEa3756b962e964fadb61e31df1f7dd5a3 \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {ORG_ID}' \
  -H 'Accept: application/vnd.api+json;revision=1' \
  -H 'Content-Type: application/vnd.api+json' \
  -d '{
        "data": {
          "attributes": {
            "type_of": "token"
          },
          "meta": {
            "action": "retry"
          },
          "id": "SEa3756b962e964fadb61e31df1f7dd5a3",
          "type": "secrets"
        }
      }'
Proprietà
Descrizione
attributes
Deve contenere una proprietà type_of corrispondente a quella del segreto da aggiornare (token, simple-http o oauth2).
meta
Deve contenere una proprietà action con valore retry.
id
ID del segreto che stai ritentando. Deve corrispondere all’ID fornito nel percorso della richiesta.
type
Tipo di risorsa su cui viene eseguita l’operazione. Deve essere impostato su secrets.

Risposta

In caso di esito positivo, la risposta restituisce i dettagli del segreto, con il relativo stato reimpostato su pending. Al termine dello scambio, lo stato del segreto verrà aggiornato a succeeded o failed a seconda del risultato.

{
  "data": {
    "id": "SEa3756b962e964fadb61e31df1f7dd5a3",
    "type": "secrets",
    "attributes": {
      "created_at": "2021-07-16T22:29:41.135Z",
      "updated_at": "2021-07-16T22:29:41.135Z",
      "name": "Example Secret",
      "type_of": "token",
      "activated_at": null,
      "expires_at": null,
      "refresh_at": null,
      "status": "pending",
      "credentials": {
        }
    },
    "relationships": {
      "property": {
        "links": {
          "related": "https://reactor.adobe.io/secrets/SEa3756b962e964fadb61e31df1f7dd5a3/property"
        },
        "data": {
          "id": "PR19717d5acf114209a5aebd0f2b228438",
          "type": "properties"
        }
      },
      "environment": {
        "links": {
          "related": "https://reactor.adobe.io/secrets/SEa3756b962e964fadb61e31df1f7dd5a3/environment"
        },
        "data": {
          "id": "EN04d820606cc74d5eaf51616e8b50201a",
          "type": "environments"
        },
        "meta": {
          "stage": "development"
        }
      },
      "notes": {
        "links": {
          "related": "https://reactor.adobe.io/secrets/SEa3756b962e964fadb61e31df1f7dd5a3/notes"
        }
      }
    },
    "links": {
      "self": "https://reactor.adobe.io/secrets/SEa3756b962e964fadb61e31df1f7dd5a3",
      "property": "https://reactor.adobe.io/secrets/SEa3756b962e964fadb61e31df1f7dd5a3/property"
    }
  }
}

Riautorizza un segreto oauth2-google reauthorize

Ogni segreto oauth2-google contiene una proprietà meta.authorization_url_expires_at che indica la scadenza dell'URL di autorizzazione. Trascorso questo tempo, il segreto deve essere nuovamente autorizzato per poter rinnovare il processo di autenticazione.

Per autorizzare nuovamente un segreto oauth2-google, effettuare una richiesta PATCH per il segreto in questione.

Formato API

PATCH /secrets/{SECRET_ID}
Parametro
Descrizione
{SECRET_ID}
id del segreto che si desidera autorizzare di nuovo.

Richiesta

L'oggetto data nel payload della richiesta deve contenere una proprietà meta.action impostata su reauthorize.

curl -X PATCH \
  https://reactor.adobe.io/secrets/SEa3756b962e964fadb61e31df1f7dd5a3 \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {ORG_ID}' \
  -H 'Accept: application/vnd.api+json;revision=1' \
  -H 'Content-Type: application/vnd.api+json' \
  -d '{
        "data": {
          "attributes": {
            "type_of": "oauth2-google"
          },
          "meta": {
            "action": "reauthorize"
          },
          "id": "SEa3756b962e964fadb61e31df1f7dd5a3",
          "type": "secrets"
        }
      }'

Risposta

In caso di esito positivo, la risposta restituisce i dettagli del segreto aggiornato. Da qui è necessario copiare e incollare meta.authorization_url in un browser per completare il processo di autorizzazione.

{
  "data": {
    "id": "SE5fdfa4c0a2d8404e8b1bc38827cc41c9",
    "type": "secrets",
    "attributes": {
      "created_at": "2021-07-15T19:00:25.628Z",
      "updated_at": "2021-07-15T19:00:25.628Z",
      "name": "Example Secret",
      "type_of": "oauth2-google",
      "activated_at": null,
      "expires_at": null,
      "refresh_at": null,
      "status": "pending",
      "credentials": {
        "scopes": [
          "https://www.googleapis.com/auth/adwords",
          "https://www.googleapis.com/auth/pubsub"
        ],
      }
    },
    "relationships": {
      "property": {
        "links": {
          "related": "https://reactor.adobe.io/secrets/SE5fdfa4c0a2d8404e8b1bc38827cc41c9/property"
        },
        "data": {
          "id": "PR9eff664dc6014217b76939bb78b83976",
          "type": "properties"
        }
      },
      "environment": {
        "links": {
          "related": "https://reactor.adobe.io/secrets/SE5fdfa4c0a2d8404e8b1bc38827cc41c9/environment"
        },
        "data": {
          "id": "EN04cdddbdb6574170bcac9f470f3b8087",
          "type": "environments"
        },
        "meta": {
          "stage": "development"
        }
      },
      "notes": {
        "links": {
          "related": "https://reactor.adobe.io/secrets/SE5fdfa4c0a2d8404e8b1bc38827cc41c9/notes"
        }
      }
    },
    "links": {
      "self": "https://reactor.adobe.io/secrets/SE5fdfa4c0a2d8404e8b1bc38827cc41c9",
      "property": "https://reactor.adobe.io/secrets/SE5fdfa4c0a2d8404e8b1bc38827cc41c9/property"
    },
    "meta": {
      "authorization_url": "https://accounts.google.com/o/oauth2/auth?access_type=offline&approval_prompt=force&client_id=434635668552-0qvlu519fdjtnkvk8hu8c8dj8rg3723r.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Freactor.adobe.io%2Foauth2%2Fcallback&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fadwords&state=state",
      "authorization_url_expires_at": "2021-07-15T20:00:25.628Z"
    }
  }
}

Eliminare un segreto delete

Per eliminare un segreto, devi includere il relativo ID nel percorso di una richiesta DELETE. Si tratta di una cancellazione definitiva con effetto immediato che non richiede la ripubblicazione della libreria.

Questa operazione rimuove il segreto dall’ambiente a cui è correlato e la risorsa sottostante viene eliminata.

WARNING
Se disponi di regole distribuite che fanno riferimento a un segreto eliminato, queste cesseranno immediatamente di funzionare. Tutti gli elementi di dati che fanno riferimento a questo segreto devono essere aggiornati o rimossi in seguito.

Formato API

DELETE /secrets/{SECRET_ID}
Parametro
Descrizione
{SECRET_ID}
ID del segreto che desideri eliminare.

Richiesta

curl -X DELETE \
  https://reactor.adobe.io/secrets/SEa3756b962e964fadb61e31df1f7dd5a3 \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {ORG_ID}' \
  -H 'Accept: application/vnd.api+json;revision=1' \
  -H 'Content-Type: application/vnd.api+json'

Risposta

In caso di esito positivo, la risposta restituisce lo stato HTTP 204 (nessun contenuto) e un corpo di risposta vuoto, a indicare che il segreto è stato eliminato dal sistema.

Elencare le note per un segreto notes

L’API di Reactor consente di aggiungere note a determinate risorse, inclusi i segreti. Le note sono annotazioni testuali che non hanno alcun impatto sul comportamento delle risorse e possono essere utilizzate per diversi casi d’uso.

NOTE
Per informazioni dettagliate su come creare e modificare le note per le risorse API di Reactor, consulta la guida dell’endpoint "notes".

Per recuperare tutte le note relative a un segreto, effettua una richiesta GET.

Formato API

GET /secrets/{SECRET_ID}/notes
Parametro
Descrizione
{SECRET_ID}
ID del segreto di cui desideri elencare le note.

Richiesta

curl -X GET \
  https://reactor.adobe.io/secrets/SE591d3b86910f4e6883f0e1c36e54bff1/notes \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {ORG_ID}' \
  -H 'Accept: application/vnd.api+json;revision=1' \
  -H 'Content-Type: application/vnd.api+json'

Risposta

In caso di esito positivo, la risposta restituisce un elenco di note appartenenti al segreto.

{
  "data": [
    {
      "id": "NTe666dbcc2f204218b6fde2fe60ab7043",
      "type": "notes",
      "attributes": {
        "author_display_name": "John Doe",
        "author_email": "jdoe@example.com",
        "created_at": "2021-07-16T22:29:58.259Z",
        "text": "This is a secret note."
      },
      "relationships": {
        "resource": {
          "links": {
            "related": "https://reactor.adobe.io/secrets/SE591d3b86910f4e6883f0e1c36e54bff1"
          },
          "data": {
            "id": "SE591d3b86910f4e6883f0e1c36e54bff1",
            "type": "secrets"
          }
        }
      },
      "links": {
        "resource": "https://reactor.adobe.io/secrets/SE591d3b86910f4e6883f0e1c36e54bff1",
        "self": "https://reactor.adobe.io/notes/NTe666dbcc2f204218b6fde2fe60ab7043"
      }
    }
  ],
  "meta": {
    "pagination": {
      "current_page": 1,
      "next_page": null,
      "prev_page": null,
      "total_pages": 1,
      "total_count": 1
    }
  }
}

Recuperare le risorse correlate per un segreto related

Le seguenti chiamate mostrano come recuperare le risorse correlate per un segreto. Quando cerca un segreto, queste relazioni sono elencate nella proprietà relationships.

Per ulteriori informazioni sulle relazioni nell’API di Reactor, consulta la guida delle relazioni.

Cercare un segreto nell’ambiente correlato environment

Per cercare l'ambiente che utilizza un segreto, devi aggiungere /environment al percorso di una richiesta GET.

Formato API

GET /secrets/{SECRET_ID}/environment
Parametro
Descrizione
{SECRET_ID}
ID del segreto di cui desideri cercare l’ambiente.

Richiesta

curl -X GET \
  https://reactor.adobe.io/secrets/SEa3756b962e964fadb61e31df1f7dd5a3/environment \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {ORG_ID}' \
  -H 'Accept: application/vnd.api+json;revision=1' \
  -H 'Content-Type: application/vnd.api+json'

Risposta

In caso di esito positivo, la risposta restituisce i dettagli dell’ambiente.

{
  "data": {
    "id": "EN33e8d63ac647448da1f77ced5c3c8580",
    "type": "environments",
    "attributes": {
      "archive": false,
      "created_at": "2021-07-16T22:19:13.438Z",
      "library_path": "bc12f2b85d11/b9a3067414ff",
      "library_name": "launch-3b6c4eea15ae-development.min.js",
      "library_entry_points": [
        {
          "library_name": "launch-3b6c4eea15ae-development.min.js",
          "minified": true,
          "references": [
            "bc12f2b85d11/b9a3067414ff/launch-3b6c4eea15ae-development.min.js"
          ],
          "license_path": "bc12f2b85d11/b9a3067414ff/launch-3b6c4eea15ae-development.js"
        },
        {
          "library_name": "launch-3b6c4eea15ae-development.js",
          "minified": false,
          "references": [
            "bc12f2b85d11/b9a3067414ff/launch-3b6c4eea15ae-development.js"
          ]
        }
      ],
      "name": "Development Environment A",
      "path": null,
      "stage": "development",
      "updated_at": "2021-07-16T22:19:13.438Z",
      "status": "succeeded",
      "token": "3b6c4eea15ae"
    },
    "relationships": {
      "library": {
        "links": {
          "related": "https://reactor.adobe.io/environments/EN33e8d63ac647448da1f77ced5c3c8580/library"
        },
        "data": null
      },
      "builds": {
        "links": {
          "related": "https://reactor.adobe.io/environments/EN33e8d63ac647448da1f77ced5c3c8580/builds"
        }
      },
      "host": {
        "links": {
          "related": "https://reactor.adobe.io/environments/EN33e8d63ac647448da1f77ced5c3c8580/host",
          "self": "https://reactor.adobe.io/environments/EN33e8d63ac647448da1f77ced5c3c8580/relationships/host"
        },
        "data": {
          "id": "HT7d5cf665463e46a1968ada1ceb1b5ca7",
          "type": "hosts"
        }
      },
      "property": {
        "links": {
          "related": "https://reactor.adobe.io/environments/EN33e8d63ac647448da1f77ced5c3c8580/property"
        },
        "data": {
          "id": "PRba81d3027db846b084212391aa5d2f1f",
          "type": "properties"
        }
      }
    },
    "links": {
      "property": "https://reactor.adobe.io/properties/PRba81d3027db846b084212391aa5d2f1f",
      "self": "https://reactor.adobe.io/environments/EN33e8d63ac647448da1f77ced5c3c8580"
    },
    "meta": {
      "archive_encrypted": false
    }
  }
}

Cercare la proprietà correlata per un segreto property

Per cercare la proprietà a cui appartiene un segreto, devi aggiungere /property al percorso di una richiesta GET.

Formato API

GET /secrets/{SECRET_ID}/property
Parametro
Descrizione
{SECRET_ID}
ID del segreto di cui desideri cercare la proprietà.

Richiesta

curl -X GET \
  https://reactor.adobe.io/secrets/SEa3756b962e964fadb61e31df1f7dd5a3/property \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {ORG_ID}' \
  -H 'Accept: application/vnd.api+json;revision=1' \
  -H 'Content-Type: application/vnd.api+json'

Risposta

In caso di esito positivo, la risposta restituisce i dettagli della proprietà.

{
  "data": {
    "id": "PR2d191feafef54c5da4ddb5ef647d4867",
    "type": "properties",
    "attributes": {
      "created_at": "2021-07-16T22:26:25.320Z",
      "enabled": true,
      "name": "Kessel Edge Example Property",
      "updated_at": "2021-07-16T22:26:25.320Z",
      "platform": "edge",
      "development": false,
      "token": "8efbe7023155"
    },
    "relationships": {
      "company": {
        "links": {
          "related": "https://reactor.adobe.io/properties/PR2d191feafef54c5da4ddb5ef647d4867/company"
        },
        "data": {
          "id": "COc26fb19f87d24cbe827a70ad2a672093",
          "type": "companies"
        }
      },
      "callbacks": {
        "links": {
          "related": "https://reactor.adobe.io/properties/PR2d191feafef54c5da4ddb5ef647d4867/callbacks"
        }
      },
      "hosts": {
        "links": {
          "related": "https://reactor.adobe.io/properties/PR2d191feafef54c5da4ddb5ef647d4867/hosts"
        }
      },
      "environments": {
        "links": {
          "related": "https://reactor.adobe.io/properties/PR2d191feafef54c5da4ddb5ef647d4867/environments"
        }
      },
      "libraries": {
        "links": {
          "related": "https://reactor.adobe.io/properties/PR2d191feafef54c5da4ddb5ef647d4867/libraries"
        }
      },
      "data_elements": {
        "links": {
          "related": "https://reactor.adobe.io/properties/PR2d191feafef54c5da4ddb5ef647d4867/data_elements"
        }
      },
      "extensions": {
        "links": {
          "related": "https://reactor.adobe.io/properties/PR2d191feafef54c5da4ddb5ef647d4867/extensions"
        }
      },
      "rules": {
        "links": {
          "related": "https://reactor.adobe.io/properties/PR2d191feafef54c5da4ddb5ef647d4867/rules"
        }
      },
      "notes": {
        "links": {
          "related": "https://reactor.adobe.io/properties/PR2d191feafef54c5da4ddb5ef647d4867/notes"
        }
      }
    },
    "links": {
      "company": "https://reactor.adobe.io/companies/COc26fb19f87d24cbe827a70ad2a672093",
      "data_elements": "https://reactor.adobe.io/properties/PR2d191feafef54c5da4ddb5ef647d4867/data_elements",
      "environments": "https://reactor.adobe.io/properties/PR2d191feafef54c5da4ddb5ef647d4867/environments",
      "extensions": "https://reactor.adobe.io/properties/PR2d191feafef54c5da4ddb5ef647d4867/extensions",
      "rules": "https://reactor.adobe.io/properties/PR2d191feafef54c5da4ddb5ef647d4867/rules",
      "self": "https://reactor.adobe.io/properties/PR2d191feafef54c5da4ddb5ef647d4867"
    },
    "meta": {
      "rights": [
        "approve",
        "develop",
        "edit_property",
        "manage_environments",
        "manage_extensions",
        "publish"
      ]
    }
  }
}
recommendation-more-help
12b4e4a9-5028-4d88-8ce6-64a580811743