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

Send appname as header on DCL upload #94

Merged
merged 2 commits into from
Aug 20, 2024
Merged

Send appname as header on DCL upload #94

merged 2 commits into from
Aug 20, 2024

Conversation

d047491
Copy link
Contributor

@d047491 d047491 commented Aug 15, 2024

Send appname as header X-Appname on dcl-upload

@d047491 d047491 requested a review from f-blass August 15, 2024 12:58
UserAgent: fmt.Sprintf("cloud-authorization-buildpack/%s", s.BuildpackVersion),
ExtraHeaders: map[string]string{
"User-Agent": fmt.Sprintf("cloud-authorization-buildpack/%s", s.BuildpackVersion),
"X-Cf-Appname": vcapApp.ApplicationName,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use a more generic name that also fits for other use cases, e.g. if we provide some functionality to upload via CAP or as a k8s job. E.g. just remove the cf part? X-App-Name or X-Appname ?

Comment on lines 24 to 37
ApplicationID string `json:"application_id"`
ApplicationName string `json:"application_name"`
ApplicationUris []string `json:"application_uris"`
CfAPI string `json:"cf_api"`
Limits struct {
Fds int `json:"fds"`
} `json:"limits"`
Name string `json:"name"`
OrganizationID string `json:"organization_id"`
OrganizationName string `json:"organization_name"`
SpaceID string `json:"space_id"`
SpaceName string `json:"space_name"`
Uris []string `json:"uris"`
Users any `json:"users"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I can see, only the ApplicationName is used in the coding. Let's strip down the struct to what we need exactly, no need to parse the other values.

Users any `json:"users"`
}

func LoadVcapApplication(log *libbuildpack.Logger) (VcapApplication, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This func always returns error = nil. Remove error return value?

@d047491 d047491 force-pushed the upload_with_appname branch from 3030efe to 1aac254 Compare August 19, 2024 14:25
@d047491 d047491 requested a review from f-blass August 19, 2024 14:26
@d047491
Copy link
Contributor Author

d047491 commented Aug 19, 2024

commited suggested changes

@f-blass f-blass changed the title send more upload information via headers Send appname as header on DCL upload Aug 20, 2024
@f-blass f-blass merged commit 133075c into main Aug 20, 2024
8 checks passed
@f-blass f-blass deleted the upload_with_appname branch August 20, 2024 10:21
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

Successfully merging this pull request may close these issues.

2 participants