Skip to content

Commit

Permalink
Updates GRPC context version
Browse files Browse the repository at this point in the history
  • Loading branch information
zackslash committed Sep 25, 2017
1 parent bb1b698 commit 8f025b2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion accountDetails.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
9 changes: 7 additions & 2 deletions example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}*/
}
2 changes: 1 addition & 1 deletion identityIDs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion loginTimestamp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions managementPermissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 8f025b2

Please sign in to comment.