Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cc 7145 hcp link status api #1285

Open
4 tasks
dhiaayachi opened this issue Sep 28, 2024 · 0 comments
Open
4 tasks

Cc 7145 hcp link status api #1285

dhiaayachi opened this issue Sep 28, 2024 · 0 comments

Comments

@dhiaayachi
Copy link
Owner

Description

https://hashicorp.atlassian.net/browse/CC-7145
Due to the API specific, it doesn't fall well to the data loading approach which is used for regular records.
So I did similar to autopilot loading, which as well not really fall under record architecture(list + crud).

for 404 link/global and for STATE_FALSE repository maps the isLinking value to false. For STATE_TRUE - to true. For other error codes, repo return null for the result object (to make it possible to understand when some other system/auth error raised)

Testing & Reproduction steps

  1. add Linked is: {{hcpLink.data.isLinked}} in a next line
  2. using consul-setup repo and its README
  3. Build consul
  4. login with ACLS consul acl bootstrap, using secretId
  5. check the label

It is also possible to check it with yarn start. Mock data set to STATE_TRUE by default

link/global could be added with triggering from browser console

fetch("https://localhost:8501/api/hcp/v2/link/global", {
  "headers": {
    "accept": "*/*",
    "accept-language": "en-US,en;q=0.9",
    "content-type": "application/json; charset=utf-8",
    "sec-ch-ua": "\"Not_A Brand\";v=\"8\", \"Chromium\";v=\"120\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"macOS\"",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-origin",
    "x-consul-token": "<PAST HERE Secret ID>",
    "x-requested-with": "XMLHttpRequest"
  },
  "referrer": "https://localhost:8501/ui/dc1/services",
  "referrerPolicy": "strict-origin-when-cross-origin",
  "body": JSON.stringify(
      { data: {
          client_id: "Sq2HHIo5TjBvasTXTJW8L9yRzwjEaERs",
          resource_id: "organization/7309cdc4-d05a-4d84-af5d-40bf5adbb424/project/e38aa34e-1120-43f1-9092-c529e8595e3f/hashicorp.consul.global-network-manager.cluster/eeeeeee",
          client_secret: "elg9GrWkz6KjWBR6tgQkrix41LKcgHlUHxwArQuUZk46JFBq6KXsRhuEt8T5qyC_"
      }
      }
  ),
  "method": "PUT",
  "mode": "cors",
  "credentials": "include"
});

Links

PR Checklist

  • updated test coverage
  • external facing docs updated
  • appropriate backport labels added
  • not a security concern
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant