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

Create a versioned common Space interface for Spaces API endpoints #159708

Closed
Tracked by #158334
legrego opened this issue Jun 14, 2023 · 1 comment · Fixed by #160237
Closed
Tracked by #158334

Create a versioned common Space interface for Spaces API endpoints #159708

legrego opened this issue Jun 14, 2023 · 1 comment · Fixed by #160237
Assignees
Labels
chore Feature:Security/Spaces Platform Security - Spaces feature Project:Serverless Work as part of the Serverless project for its initial release Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!

Comments

@legrego
Copy link
Member

legrego commented Jun 14, 2023

Our spaces client "transforms" a Space saved object into the current common interface type by spreading all the SO attributes. We need to explicitly map the SO attributes to a new versioned interface.

private transformSavedObjectToSpace(savedObject: SavedObject<any>) {
return {
id: savedObject.id,
...savedObject.attributes,
} as Space;
}

Guidance: https://docs.elastic.dev/kibana-dev-docs/versioning-interfaces
Example: #152111
Master Doc: https://docs.google.com/document/d/1wSj6S5mvbiZ-YeGnrH3McXl0EgLHIXj5T1kkVrbkov4/edit?pli=1#heading=h.ldcj84g80m8x

@botelastic botelastic bot added the needs-team Issues missing a team label label Jun 14, 2023
@legrego legrego added chore Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! Feature:Security/Spaces Platform Security - Spaces feature Project:Serverless Work as part of the Serverless project for its initial release labels Jun 14, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security (Team:Security)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Jun 14, 2023
@legrego legrego changed the title Create a versioned common Space interface for Spaces API endpoints (see guidance and example). Our spaces client "transforms" a Space saved object into the current common interface type by spreading all the SO attributes. We need to explicitly map the SO attributes to a new versioned interface. Create a versioned common Space interface for Spaces API endpoints Jun 14, 2023
@jeramysoucy jeramysoucy self-assigned this Jun 22, 2023
jeramysoucy added a commit that referenced this issue Jun 28, 2023
Closes #159708

## Summary

This PR replaces the common Space interface with a versioned interface
per [The road to versioned HTTP APIs
doc](https://docs.google.com/document/d/1wSj6S5mvbiZ-YeGnrH3McXl0EgLHIXj5T1kkVrbkov4/edit?pli=1#heading=h.ldcj84g80m8x),
and guidance of [Versioning
Interfaces](https://docs.elastic.dev/kibana-dev-docs/versioning-interfaces).
Additionally, this PR replaces the implicit use of saved object
attributes with an explicit conversion from the SO attributes to
versioned interface properties.

### Tests
-
x-pack/plugins/spaces/server/spaces_client/spaces_client_service.test.ts
- x-pack/test/functional/apps/spaces
- x-pack/test/api_integration/apis/spaces

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Feature:Security/Spaces Platform Security - Spaces feature Project:Serverless Work as part of the Serverless project for its initial release Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants