diff --git a/accountDetails.go b/accountDetails.go index ecb95ff..4f12668 100644 --- a/accountDetails.go +++ b/accountDetails.go @@ -56,7 +56,7 @@ func (i *Instance) GetAccountDetailsForIdentityIDs(identityIDs []string) ([]Acco if err != nil { return []AccountDetail{}, err } - ctx := metadata.NewContext(context.Background(), meta) + ctx := metadata.NewOutgoingContext(context.Background(), meta) conn, err := grpc.Dial(i.fidentEndpoint, grpc.WithTransportCredentials(credentials.NewTLS(tls.FidentTSLConfig))) if err != nil { diff --git a/example/main.go b/example/main.go index 472a6f0..ef83d75 100644 --- a/example/main.go +++ b/example/main.go @@ -7,13 +7,13 @@ import ( ) const ( - keyfilePath = "./testkeyb.json" + keyfilePath = "./testkey.json" ) func main() { // Create new fident client with path to keyfile.json and fident instance address // (Note you can use 'client.FidentInstanceAddressSharedLocal' variable to connect using deckard env vars) - testClient, err := client.New(keyfilePath, client.FidentInstanceAddressSharedLocal) + testClient, err := client.New("./cubex_cloud_testkey.json", client.FidentInstanceAddressSharedLocal) if err != nil { panic(err) } @@ -41,4 +41,9 @@ func main() { } fmt.Printf("All IDs Result: %v\n", ids) + + /*err = testClient.AddManagementPermission("EFIDFIID-ZGTMFQ1EO-MISCR-IAPZNMF", permissions.PermissionAll) + if err != nil { + panic(err) + }*/ } diff --git a/identityIDs.go b/identityIDs.go index 1aa4083..9428350 100644 --- a/identityIDs.go +++ b/identityIDs.go @@ -17,7 +17,7 @@ func (i *Instance) GetAllIdentityIDsForProject() ([]string, error) { if err != nil { return []string{}, err } - ctx := metadata.NewContext(context.Background(), meta) + ctx := metadata.NewOutgoingContext(context.Background(), meta) conn, err := grpc.Dial(i.fidentEndpoint, grpc.WithTransportCredentials(credentials.NewTLS(tls.FidentTSLConfig))) if err != nil { diff --git a/loginTimestamp.go b/loginTimestamp.go index e2f56cd..2e6d96c 100644 --- a/loginTimestamp.go +++ b/loginTimestamp.go @@ -33,7 +33,7 @@ func (i *Instance) GetLastLoginTimestampsForIdentityIDs(identityIDs []string) (m if err != nil { return map[string]time.Time{}, err } - ctx := metadata.NewContext(context.Background(), meta) + ctx := metadata.NewOutgoingContext(context.Background(), meta) conn, err := grpc.Dial(i.fidentEndpoint, grpc.WithTransportCredentials(credentials.NewTLS(tls.FidentTSLConfig))) if err != nil { diff --git a/managementPermissions.go b/managementPermissions.go index 589b68b..07a105c 100644 --- a/managementPermissions.go +++ b/managementPermissions.go @@ -18,7 +18,7 @@ func (i *Instance) GetManagementPermissions(identityID string) ([]permissions.En if err != nil { return []permissions.Entry{}, err } - ctx := metadata.NewContext(context.Background(), meta) + ctx := metadata.NewOutgoingContext(context.Background(), meta) conn, err := grpc.Dial(i.fidentEndpoint, grpc.WithTransportCredentials(credentials.NewTLS(tls.FidentTSLConfig))) if err != nil { @@ -52,7 +52,7 @@ func (i *Instance) AddManagementPermission(identityID string, permission permiss return err } - ctx := metadata.NewContext(context.Background(), meta) + ctx := metadata.NewOutgoingContext(context.Background(), meta) conn, err := grpc.Dial(i.fidentEndpoint, grpc.WithTransportCredentials(credentials.NewTLS(tls.FidentTSLConfig))) if err != nil { return err @@ -78,7 +78,7 @@ func (i *Instance) RemoveManagementPermission(identityID string, permission perm return err } - ctx := metadata.NewContext(context.Background(), meta) + ctx := metadata.NewOutgoingContext(context.Background(), meta) conn, err := grpc.Dial(i.fidentEndpoint, grpc.WithTransportCredentials(credentials.NewTLS(tls.FidentTSLConfig))) if err != nil { return err