This project adheres to Semantic Versioning.
The following changes are pending, and will be applied on the next major release:
- The
getAccessGrantAll
function is deprecated. It can be replaced withquery
. Although the two functions' behavior is different, they can be used to achieve similar results. - The
gConsent
and all ofgConsent/*
submodules are deprecated. The former can be replaced by a regular import of the library, and the latter can be replaced with the equivalent non-gConsent submodules (e.g.gConsent/manage
can be replaced withmanage
). There is no functionality change between the two.
- Type declarations have been altered so that internal type declarations are no longer
partially exposed in the type declaration files. This prevents issues with some
frameworks, such as Angular, in particular with
revokeAccessCredential
being internal.
3.2.0 - 2024-12-23
- Add support for custom fields. Applications are now able to read and write custom fields
into Access Credentials (both Access Requests and Access Grants). This feature is available
via a new option introduced in
issueAccessRequest
andapproveAccessRequest
to write the custom fields, and via a set of dedicated getters in thegetters/
module. A generic getter is introduced,getCustomFields
, as well as a set of typed helpers, such asgetCustomInteger
. Typed helpers are available for integers, floats, strings and booleans. - Support new query endpoint: the new
query
function enables querying for Access Credentials using the newly introduced ESS endpoint.
3.1.1 - 2024-10-23
- Added support for the
https://schema.inrupt.com/credentials/v2.jsonld
JSON-LD context.
3.1.0 - 2024-09-16
- Node 22 is now supported
- The
/resources
module function have their signature now aligned with the underlying@inrupt/solid-client
functions. Namely, theoptions
parameter forsaveSolidDatasetAt
andgetSolidDataset
support additional entries that were already available in@inrupt/solid-client
.
3.0.5 - 2024-07-31
- Removed base64url dependency due to potential issues with the browser environment.
- A descriptive error is now thrown when trying to create an access request/approve an access grant for no resources. Note that previously, such call may not have thrown, but it resulted in an Access Grant granting access to nothing, which would have caused confusion when trying to use it.
- The error thrown when the issuer endpoint for an access grant/request cannot be computed is more comprehensive.
3.0.4 - 2024-02-12
- Extend predicate supported by
getRequestor
:getRequestor
now supports thegc:isProvidedToPerson
andgc:isProvidedToController
predicates in addition to the currentgc:isProvidedTo
predicate.
3.0.3 - 2024-02-06
- Internal function
getConsent
is no longer part of the exports, which was causing TS to not build in some setups.
3.0.2 - 2024-01-22
getAccessGrantAll
no longer includes duplicates in the result set when using a container filtering by resource.
3.0.1 - 2024-01-10
getAccessGrantAll
incorrectly excluded non-recursive grants if not filtering on target resource.
3.0.0 - 2023-12-22
- Parsing Access Grants and Access Requests as RDF from JSON-LD: This allows the Access Grants
and Access Requests to be read using the RDF/JS DatasetCore API. This is a breaking change,
because their type also now extends the
DatasetCore
type. Importantly, this dataset is not preserved when converting a Verifiable Credential to a string and back doingJSON.parse(JSON.stringify(verifiableCredential))
. We reccomend that developers setreturnLegacyJsonld
tofalse
in functions such asgetAccessGrant
in order to avoid returning deprecated object properties. Instead developers should make use of the exportedgetter
functions to get these attributes. - Node 16 is no longer supported: The global
fetch
function is now used instead of@inrupt/universal-fetch
. This means this library now only works with Node 18 and higher. - Deprecated signatures removed:
denyAccessRequest
no longer supports theresourceOwner
argument, it must be removed.approveAccessRequest
no longer supports theresourceOwner
argument, it must be removed.getAccessGrantAll
no longer supports theresource
argument, which should be merged into theparams
argument along the otherAccessParameter
.
2.6.2 - 2023-11-16
- Support for
odrl
access grants has been removed. The ODRL data model was in as an experimental feature, and wasn't deployed in any supported Access Grant issuers. Removing it will not break apps using the currently supported gConsent-based Access Grants.
- Denied Access Grant expiration date: When denying an access grant based on an access request, the exipration date of the access request wasn't being picked up as the expiration date for the denied grant.
2.6.1 - 2023-09-25
denyAccessRequest
didn't normalize the returned denied Access Grant, resulting in it having a JSON-LD frame different from the value returned byapproveAccessRequest
. The value is now normalized, and both functions return a similarly shaped object. This also fixes the return type ofdenyAccessRequest
, which now returns the more strictAccessGrant
type rather than theVerifiableCredential
type.- add
types
entry in the package.json exports so that bundlers such as esbuild can discover type definitions.
2.6.0 - 2023-09-18
- Export
getAccessGrantAll
has a newstatus
parameter which allows selection ofgranted
,denied
orall
access grants. By default onlygranted
access grants are returned as this is the existing behavior. In the next major version of this library the default will be to returnall
access grants.
2.5.0 - 2023-08-11
- Export
CredentialIsAccessGrantAny
which checks if aVerifiableCredential
is anAccessGrantAny
.
2.4.0 - 2023-07-24
deleteSolidDataset
anddeleteFile
: Add functions to theresource
module to delete resources, following the interface of@inrupt/solid-client
.getAccessRequest
: a function exported by the./manage
module to get the Access Request from the Access Request URL.
2.3.2 - 2023-06-05
resource
marked as deprecated forgetAccessGrantAll
. It can be optionally passed along withparams
.
2.3.1 - 2023-05-24
- Buffer API marked as deprecated for
saveFileInContainer
andoverwriteFileInContainer
.
- Denied Access Grants now preserve the purpose set in the original Access Request.
2.3.0 - 2023-05-09
- Node 20 support
2.2.0 - 2023-04-14
- Node 18 support
2.1.2 - 2023-02-06
- The JSON-LD/JSON normalization is now applied not only when issuing an Access Request or an Access Grant, but also when dereferencing one.
2.1.1 - 2023-02-01
-
JSON-LD/JSON alignment: We are processing Verifiable Credentials as plain JSON, while they actually are JSON-LD. This creates some discrepancies:
- The Access Grants and Access Requests status is now accepted in its abbreviated form, and not only as a fully qualified IRI, as allowed by the JSON-LD context.
- Arrays containing a single value are also accepted as a literal equal to said single value.
This is a stopgap solution: a proper fix would be to do full JSON-LD parsing, but we aren't doing it for the moment because of issues between existing libraries and our build setup.
2.1.0 - 2023-01-06
- Added the
createContainerInContainer
method. - Added
saveSolidDatasetInContainer
method. - Added the
updateAcr
flag to the options that can be included when calling theapproveAccessRequest
method.updateAcr
will default totrue
. Note that this is an advanced feature, and only users having a good understanding of the relationship between Access Grants and ACRs should deviate from the default. Additional information is available in the ESS documentation - Added the
inherit
flag toissueAccessRequest
andapproveAccessRequest
to allow controlling whether the issued Access Grant should apply recursively to the target containers' contained resources. - The
getAccessGrantAll
method now allows discovering recursive Access Grants issued for an ancestor container.
- The
getters
module contains functions and a class to interact with Verifiable Credentials without having to hard-code the data model in your application.
2.0.0 - 2022-11-03
getAccessRequestFromRedirectUrl
andgetAccessGrantFromRedirectUrl
no longer pick up VC passed by value, and only support passing by IRI. This is for security reasons, as passing a VC by value in the IRI leaks information. This removes a behavior that has been deprecated in v0.5.0. This change doesn't affect you if you are using the query parameters accessors (getAccessRequestFromRedirectUrl
andgetAccessGrantFromRedirectUrl
).
- The
getters
module functions now support ODRL Access Grants. AccessGrantOdrl
,AccessGrantGConsent
andAccessGrantAny
types: Both the ODRL-based and the GConsent-based Access Grants now have an explicit associated type. Functions that support both data model may use theAccessGrantAllAny
union type.gConsent
andodrl
API objects: in order to support a new schema for Access Grants, new functions will be added to the API. They will not be compatible with the current data model, so the new API will be exported via theodrl
object for backwards compatibility. After the current API is deprecated, the default exports will point toodrl
.getAccessRequestFromRedirectUrl
andgetAccessGrantFromRedirectUrl
now accept URL objects as well as plain strings.approveAccessRequest
now accepts anull
expiration date override, resulting in the expiration date from the Access Request not being applied to the Access Grant.
1.1.0 - 2022-09-02
- Added resource APIs for
overwriteFile
andsaveFileInContainer
, these compliment the existinggetFile
method.
- Refactored resource APIs (
getFile
,getSolidDataset
,saveSolidDatasetAt
) and added end-to-end test coverage of these APIs. - Improved jest setup for node & browser unit tests.
- Added a more extensive demo app.
1.0.2 - 2022-06-21
approveAccessRequest
,getAccessGrant
,getAccessGrantFromRedirectUrl
now accurately return anAccessGrant
.getAccessRequestFromRedirectUrl
now accurately return anAccessRequest
.
- Fix Node 14 atob/btoa compatibility issue.
- The JSON-LD context of issued VCs was hard-coded, instead of being relative to the issuer domain as mandated by the ESS documentation.
1.0.1 - 2022-06-06
GRANT_VC_URL_PARAM_NAME
is now exported from the base package. This is the name of the parameter used in URL redirects to an access grant management application.
1.0.0 - 2022-06-06
- Release major version of package
0.6.1 - 2022-06-06
- Export all types via Rollup.
- Fix demo application.
- Drop Node 12 support.
0.6.0 - 2022-04-05
getAccessGrantAll
supports a new option,includeExpired
. By default, only grants that are still valid are returned by the VC provider. If set to true, grants that have expired will also be included in the response.issueAccessRequest
now generates an access request VC including the resource owner in thehasConsent
field with theisConsentForDataSubject
predicate. This will enable resource owners to dereference access requests IRIs to their resources.
- When type-checking an Access Grant (e.g. using
getAccessGrant
), only accepted Grants were supported. Support for denied Grant has now been added. - When using an Access Grant to get an Access Token, one of the claims from the server response was unaligned with the spec. This inconsistency has been fixed on the server-side with backwards-compatibility, and now on the client side too. This change is transparent to users.
approveAccessRequest
wasn't using the default session from@inrupt/solid-client-authn-browser
to set the ACR access appropriately, resulting in401 Unauthenticated
errors.getAccessRequestFromRedirectUrl
was deserializing the received VC expecting an URL-encoded value, instead of a base64-encoded value, which is how it is serialized when redirecting the user to the VC management app.
0.5.0 - 2022-03-01
redirectToRequestor
has been added to the./manage
module to help access management apps redirect their users to the clients which requested access to a Resource.getAccessRequestFromRedirectUrl
: a function exported by the./manage
module to get the Access Request and requestor redirect URL from the redirect to the Access Management App from the requestor.getAccessGrantFromRedirectUrl
: a function exported by the./request
module to get the Access Grant from the redirect to the requestor from the Access Management App.
- The JSON-LD context URL has changed from https://vc.inrupt.com/credentials/v1 to https://vc.inrupt.com/credentials/v1.
redirectToAccessManagementUi
now returns a promise that never resolves. This prevents fromawait
ing on it, have it resolve, and start running code in the undeterministic time between the moment whenwindow.location.href
is set (or the redirect callback is called) and the moment the redirection actually happens.
approveAccessRequest
anddenyAccessRequest
no longer requires theresourceOwner
parameter.issueAccessRequest
options no longer include therequestor
field.
0.4.1 - 2022-01-28
- Some dependencies have been updated to mitigate vulnerabilities.
0.4.0 - 2021-11-30
- Runnable examples are available in
examples/requestor
andexamples/grant-access
.
Rename APIs to remove the connotations that "consent" could imply. All previous APIs still exist, but are undocumented and deprecated, and will be removed in the future.
- Deprecate
approveAccessRequestWithConsent
in favour ofapproveAccessRequest
(which now supportspurpose
) - Deprecate
requestAccessWithConsent
in favour ofissueAccessRequest
(which now supportspurpose
) - Deprecate
RequestAccessWithConsentParameters
in favour ofIssueAccessRequestParameters
- Rename type
RequestAccessParameters
toIssueAccessRequestParameters
- Rename type
ConsentApiBaseOptions
toAccessBaseOptions
- Rename
requestAccess
toissueAccessRequest
- Rename
isValidConsentGrant
toisValidAccessGrant
- Rename
getAccessWithConsent
togetAccessGrant
- Rename
getAccessWithConsentAll
togetAccessGrantAll
- Rename
revokeAccess
torevokeAccessGrant
- Rename
getConsentApiEndpoint
togetAccessApiEndpoint
- Rename
getConsentManagementUi
togetAccessManagementUi
- Rename
getConsentManagementUiFromWellKnown
togetAccessManagementUiFromWellKnown
- Rename
redirectToConsentManagementUi
toredirectToAccessManagementUi
- Change
consentEndpoint
property inConsentApiBaseOptions
/AccessBaseOptions
toaccessEndpoint
(backwards compatible)
Other changes:
- Explicitly document the
IssueAccessRequestParameters
type, such that it doesn't end up on themanage
module documentation. - Ensure only the exported modules are documented by typedoc, making our documentation clearer to read.
- Fix typo in error message thrown from
getBaseAccessVerifiableCredential
- Reduce iterations needed for calculating consent guards (minor performance gain)
getSolidDataset
,getFile
, andsaveSolidDatasetAt
have been implemented as wrappers around their solid-client function calls. These take an access grant and use it to authenticate against a resource.fetchWithVc
is a generic function that uses an access grant and returns a pre-authenticatedfetch
method.
- Approving an Access Request did not update the target resources' ACR, resulting in a useless Access Grant.
- Discovering the verification endpoint was relying on incorrect assumptions, and
failed when calling
isValidConsentGrant
. - Specifying an inbox when requesting/granting access is no longer mandatory.
0.3.2 - 2021-10-29
- Looking up access grants for a given resource was issuing incorrect requests.
0.3.1 - 2021-10-21
- The property for access issuer discovery has been aligned with the one used on
the server side, i.e.
http://www.w3.org/ns/solid/terms#accessIssuer
. - The discovery for the access issuer no longer relies on the Pod server, but rather on the UMA server.
0.3.0 - 2021-10-15
redirectToConsentManagementUi
redirects to the consent management app adding the base-64 encoded VC to the IRI as a query parameter namedrequestVc
, instead of the previousrequestVcUrl
which only contained the VC IRI.
- Fix and re-enable VC type checking.
- Consent endpoint discovery from
.well-known/solid
now supports both the legacy property, and the newsolid:consent
one. - The credential subject of a grant is now the resource owner, instead of the requestor. The requestor is still the credential subject of requests.
0.2.1 - 2021-10-12
- An NPM incident made version 0.2.0 uninstallable, and publishing a new version was necessary to resolve the issue.
0.2.0 - 2021-10-11
- The 0.1.0 version had been accidentally released some time ago, creating a conflict. This just bumpts the version number to clean this up.
0.1.0 - 2021-10-11
- The shape of the consent VC obtained when approving a request wasn't valid as per the consent service expectations.
getConsentApiEndpoint
had an incorrect assumption about some behaviour ofsolid-client
, which resulted in throwing an exception, and was fixed in its version 1.13.1.
getAccessWithConsent
looks up an access grant from its IRI, and performs some validation on it.getSolidDataset
fetches a dataset from a Solid Pod, using an Acces Grant to prove the caller is entitled to access to the target resource.getAccessWithConsentAll
enables retrieving all consent grants issued over a specific resource.redirectToConsentManagementUi
enables discovering a user's preferred consent management app, and redirecting them to it.
0.0.3 - 2021-10-01
- Use complete IRIs as values for VC properties instead of shorthand that are not expanded, and therefore fail shape validation of the consent service.
- Fixes node imports as well as webpack, rollup and parcel builds
0.0.2 - 2021-09-30
- Fixed missing dependencies which failed the build using bundlers such as Webpack or Parcel.
0.0.1 - 2021-09-29
requestAccess
andrequestAccessWithConsent
: As an entity wanting to access data under a user's control, create an access request. The access request may be associated to an explicit user consent for a given purpose.approveAccessRequest
andapproveAccessRequestWithConsent
: As a person controlling some data, grant access to an entity to this data, potentially with your explicit consent for a given purpose.cancelAccessRequest
: Cancel a pending access request.denyAccessRequest
: As a person controlling some data, deny access to an entity to this data.getConsentApiEndpoint
: Discover the URL where access requests may be created for a given resource.getConsentManagementUi
: Discover the URL of a consent app where a user prefers to be redirected when prompted for consent.isValidConsentGrant
: Verify if a consent grant is valid (correct signature, issuer key match...). The verification is done at a remote endpoint, and not client-side.revokeAccess
: Revoke a consent grant.