Cloud Storage uses access control lists (ACLs) to manage object and bucket access. ACLs are the mechanism you use to share files with other users and allow other users to access your buckets and files.
To learn more about ACLs, read this overview onAccess Control.
const {Storage} = require('@google-cloud/storage');
const storage = new Storage();
storage.getHmacKeys(function(err, hmacKeys) {
if (!err) {
// hmacKeys is an array of HmacKey objects.
}
});
//-
// To control how many API requests are made and page through the results
// manually, set `autoPaginate` to `false`.
//-
const callback = function(err, hmacKeys, nextQuery, apiResponse) {
if (nextQuery) {
// More results exist.
storage.getHmacKeys(nextQuery, callback);
}
// The `metadata` property is populated for you with the metadata at the
// time of fetching.
hmacKeys[0].metadata;
};
storage.getHmacKeys({
autoPaginate: false
}, callback);
//-
// If the callback is omitted, we'll return a Promise.
//-
storage.getHmacKeys().then(function(data) {
const hmacKeys = data[0];
});
Get a reference to an HmacKey object. Note: this does not fetch the HMAC key's metadata. Use HmacKey#get() to retrieve and populate the metadata.
To get a reference to an HMAC key that's not created for a service account in the same project used to instantiate the Storage client, supply the project's ID asprojectIdin theoptionsargument.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,[]]