tdabasinskas / go-backstage Goto Github PK
View Code? Open in Web Editor NEWGo client library for accessing the Backstage REST API
Home Page: https://pkg.go.dev/github.com/tdabasinskas/go-backstage/backstage
License: Apache License 2.0
Go client library for accessing the Backstage REST API
Home Page: https://pkg.go.dev/github.com/tdabasinskas/go-backstage/backstage
License: Apache License 2.0
Hi,
first, thanks for supporting this project.
Our backstage setup use a catalog.yaml
file stores in our git repos (gitlab).
I'm working on some tooling to generate/maintain this yaml file.
One of my needs is to get the file from Git, parse it as a Go struct, update some fields then open a PR with the change.
I tried using the Entity
struct to parse the yaml, but I then need to have the specific fields of a Component
or a System
(= I need to cast the entity to the right type so I can directly access the right fields.
It feels to me it's lacking some functions to get access to each entity's specific fields, as mostly all public functions are intended to use a client that connects to the Backstage API.
Maybe I'm missing something as I'm not the best Go dev :)
Any advice or help would be greatly appreciated. If you can show me the right direction I can PR the needed changes ?
Thanks !
Some recent versions of Backstage introduce authentication via bearer tokens. The NewClient
function allows for providing one's own HTTP client and notes "To use API methods which require authentication, provide a http.Client that will perform the authentication.", however I don't see that it's possible to add an Authorization header to every request made by the client. That would have to be done inside the package.
My suggestion is to add a token field to NewClient where one could optionally provide the bearer token and have it added to all the requests made to Backstage. I'll be trying this out in my fork https://github.com/j18e/go-backstage but there could be other ways to achieve it. What do you think @tdabasinskas ?
Hello @tdabasinskas! I was wondering if there is a way to filter by an OR statement? Right now, it looks like the sdk only supports the AND. https://backstage.io/docs/features/software-catalog/software-catalog-api/#filtering For example, if I wanted to filter by namespace OR kind I would expect the query string to look like
metadata.namespace=default&filter=kind=group
. But, the SDK is creating this query param metadata.namespace=default,kind=group
Do you know if this is possible today or would there need to be a code change?
Hello @tdabasinskas ! Do you currently have a way to add a bearer token? I see that you can pass in an instance of HTTP client but this doesn't support setting a bearer token. There might be some use cases where peoples backstage instance has server to server auth turned on. https://backstage.io/docs/auth/service-to-service-auth
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.