File tree Expand file tree Collapse file tree 4 files changed +21
-8
lines changed Expand file tree Collapse file tree 4 files changed +21
-8
lines changed Original file line number Diff line number Diff line change 1- FROM --platform=$BUILDPLATFORM cgr.dev/chainguard/go:latest AS builder
1+ FROM cgr.dev/chainguard/go:latest AS builder
22ARG TARGETOS TARGETARCH
33
44WORKDIR /app
Original file line number Diff line number Diff line change 33A Go implementation of the OpenTDF protocol, and access library for services
44included in the Data Security Platform.
55
6+ Note: if you are consuming the SDK as a submodule you may need to add replace directives as follows:
7+
8+ ``` go
9+ replace (
10+ github.com /opentdf/platform/service => ./opentdf/service
11+ github.com /opentdf/platform/lib/fixtures => ./opentdf/lib/fixtures
12+ github.com /opentdf/platform/protocol/go => ./opentdf/protocol/go
13+ github.com /opentdf/platform/lib/ocrypto => ./opentdf/lib/ocrypto
14+ github.com /opentdf/platform/sdk => ./opentdf/sdk
15+ github.com /opentdf/platform/service => ./opentdf/service
16+ )
17+ ```
18+
619## Quick Start of the Go SDK
720
821``` go
922package main
1023
11- import bytes
12- import io
13- import os
14- import strings
24+ import " fmt"
25+ import " bytes"
26+ import " io"
27+ import " os"
28+ import " strings"
1529import " github.com/opentdf/platform/sdk"
1630
1731
1832func main () {
19- s := sdk.New (
33+ s , _ := sdk.New (
2034 sdk.WithAuth (mtls.NewGRPCAuthorizer (creds) /* or OIDC or whatever */ ),
2135 sdk.WithDataSecurityConfig (/* attribute schemas, kas multi-attribute mapping */ ),
2236 )
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ type Config struct {
1010
1111// AuthNConfig is the configuration need for the platform to validate tokens
1212type AuthNConfig struct {
13- AllowNoDPoP bool `yaml:"allowNoDPoP" json:"allowNoDPoP" default:"true" `
13+ AllowNoDPoP bool `yaml:"allowNoDPoP" json:"allowNoDPoP"`
1414 Issuer string `yaml:"issuer" json:"issuer"`
1515 Audience string `yaml:"audience" json:"audience"`
1616 OIDCConfiguration `yaml:"-" json:"-"`
Original file line number Diff line number Diff line change @@ -132,6 +132,5 @@ func Test_Start_When_Extra_Service_Registered_Expect_Response(t *testing.T) {
132132 respBody , err := io .ReadAll (resp .Body )
133133
134134 require .NoError (t , err )
135- // FIXME: either by adding paths that do not require authentication or by writing our own auth token
136135 assert .Equal (t , "hello from test service!" , string (respBody ))
137136}
You can’t perform that action at this time.
0 commit comments