summaryrefslogtreecommitdiff
path: root/vendor/github.com/google/go-github/v43/github/apps_manifest.go
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-07-22 17:35:49 -0600
committermo khan <mo@mokhan.ca>2025-07-22 17:35:49 -0600
commit20ef0d92694465ac86b550df139e8366a0a2b4fa (patch)
tree3f14589e1ce6eb9306a3af31c3a1f9e1af5ed637 /vendor/github.com/google/go-github/v43/github/apps_manifest.go
parent44e0d272c040cdc53a98b9f1dc58ae7da67752e6 (diff)
feat: connect to spicedb
Diffstat (limited to 'vendor/github.com/google/go-github/v43/github/apps_manifest.go')
-rw-r--r--vendor/github.com/google/go-github/v43/github/apps_manifest.go49
1 files changed, 49 insertions, 0 deletions
diff --git a/vendor/github.com/google/go-github/v43/github/apps_manifest.go b/vendor/github.com/google/go-github/v43/github/apps_manifest.go
new file mode 100644
index 0000000..164f493
--- /dev/null
+++ b/vendor/github.com/google/go-github/v43/github/apps_manifest.go
@@ -0,0 +1,49 @@
+// Copyright 2019 The go-github AUTHORS. All rights reserved.
+//
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package github
+
+import (
+ "context"
+ "fmt"
+)
+
+// AppConfig describes the configuration of a GitHub App.
+type AppConfig struct {
+ ID *int64 `json:"id,omitempty"`
+ Slug *string `json:"slug,omitempty"`
+ NodeID *string `json:"node_id,omitempty"`
+ Owner *User `json:"owner,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Description *string `json:"description,omitempty"`
+ ExternalURL *string `json:"external_url,omitempty"`
+ HTMLURL *string `json:"html_url,omitempty"`
+ CreatedAt *Timestamp `json:"created_at,omitempty"`
+ UpdatedAt *Timestamp `json:"updated_at,omitempty"`
+ ClientID *string `json:"client_id,omitempty"`
+ ClientSecret *string `json:"client_secret,omitempty"`
+ WebhookSecret *string `json:"webhook_secret,omitempty"`
+ PEM *string `json:"pem,omitempty"`
+}
+
+// CompleteAppManifest completes the App manifest handshake flow for the given
+// code.
+//
+// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#create-a-github-app-from-a-manifest
+func (s *AppsService) CompleteAppManifest(ctx context.Context, code string) (*AppConfig, *Response, error) {
+ u := fmt.Sprintf("app-manifests/%s/conversions", code)
+ req, err := s.client.NewRequest("POST", u, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ cfg := new(AppConfig)
+ resp, err := s.client.Do(ctx, req, cfg)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return cfg, resp, nil
+}