AzureAD / microsoft-authentication-library-for-go

The MSAL library for Go is part of the Microsoft identity platform for developers (formerly named Azure AD) v2.0. It enables you to acquire security tokens to call protected APIs. It uses industry standard OAuth2 and OpenID Connect.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't unmarshal a partitioned cache

chlowell opened this issue · comments

Easy to repro with a unit test in partitioned_storage_test.go:

func TestMarshal(t *testing.T) {
	mgr := newPartitionedManagerForTest(nil)
	b, err := mgr.Marshal()
	if err != nil {
		t.Fatal(err)
	}
	err = mgr.Unmarshal(b)
	if err != nil {
		t.Fatal(err)
	}
}

Unmarshal returns the error Unmarshal(*storage.InMemoryContract) only supports structs that have the field AdditionalFields or implements json.Unmarshaler. And that's spot on, storage.InMemoryContract doesn't have an AdditionalFields field.

Solved by #456

Reopening because #456 didn't merge and it's still impossible to unmarshal a partitioned cache