Unlock hidden Google secrets within your Angular application using Google Secret Manager

Can the Google Secret Manager API be accessed with a simple API call using an API key?

https://secretmanager.googleapis.com/v1/projects/*/secrets/*?key=mykey

returns a 401 unauthenticated error. While the Node.js server powering the Angular app uses the client library, there is no equivalent for Typescript.

Answer â„–1

Yes, it is technically feasible to implement this flow, but it is strongly advised against. Sharing an API key with all website users and handling parts of the oauth process yourself can lead to security risks. It is recommended to delegate this task to a server-side application that can utilize supported client libraries and execute the necessary actions securely.

  1. Utilize supported client libraries
  2. Possibly carry out the required action involving the secret and provide the response. This may not be applicable if you intend to only reveal metadata about the secret rather than its actual content.

If you are determined to proceed with this approach: Instead of using an API key, consider utilizing a service account and implementing the oauth flow through google.com/

Here are the detailed steps outlined by Google. The appropriate scope to use would likely be this one.

You can also refer to this link for more information on scopes related to Google OAuth2.

Answer â„–2

Sorry, but Secret Manager does not allow the use of API keys for authentication purposes.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

HammerJS swipe functionality does not seem to be functioning properly on elements that have the overflow CSS

UPDATE: The code snippet works smoothly when embedded in the question, but encounters issues when edited. This led me to discover that the problem lies with underlying containers that require scrolling... After testing it on my phone, I found that Hammer f ...

Querying the api for data using Angular when paginating the table

Currently, I have a table that retrieves data from an API URL, and the data is paginated by default on the server. My goal is to fetch new data when clicking on pages 2, 3, etc., returning the corresponding page's data from the server. I am using an ...

Subscribing to ngrx store triggers multiple emissions

Currently, I have an app with a ngrx store set up. I am experiencing an issue where, upon clicking a button, the function that fetches data from the store returns multiple copies of the data. Upon subsequent clicks, the number of returned copies grows expo ...

The meaning behind a textual representation as a specific type of data

This snippet is extracted from the file lib.es2015.symbol.wellknown.d.ts interface Promise<T> { readonly [Symbol.toStringTag]: "Promise"; } The concept of readonly seems clear, and the notation [Symbol.toStringTag] likely refers to "'toStr ...

Adding a constant to a Vue component

Currently working on developing an application using Vue and TypeScript. I'm focused on refactoring some aspects, particularly moving hard-coded strings from a template to a separate constant. What has been implemented is as follows: export const va ...

Retaining previous values in Angular reactive form during the (change) event callback

Imagine having an Angular reactive form with an input field. The goal is to keep track of the old value whenever the input changes and display it somewhere on the page. Below is a code snippet that achieves this functionality: @Component({ selector: & ...

The Router.url function consistently returns a forward slash instead of the actual current URL

I'm puzzled as to why, in this scenario, my current URL shows '/' when I refresh the page on '/component'. Shouldn't it show '/component' instead? However, the URL appears correct in the this.router array... Here ...

Is there a way to turn off linting while utilizing vue-cli serve?

I am currently running my project using vue-cli by executing the following command: vue-cli-service serve --open Is there a way to stop all linting? It seems like it's re-linting every time I save, and it significantly slows down the process of ma ...

Steps for setting up an auth guard:1. Define a

I am facing an issue with implementing two guards in my Angular application. The first guard is supposed to restrict unauthorized users from accessing certain pages, while the second guard is meant to prevent authorized users from accessing the "sign-in" a ...

Utilizing Angular Services - registering to component OnDestruction

I have a service called MyService which is injected into the MyComponent. My goal is for MyComponent to be able to call a function on MyService and provide a way to reference this specific instance of MyComponent so that MyService can detect when the compo ...

Troubleshooting: Issue with Dependency Injection functionality in Angular 2 starter project

I’ve encountered a strange error whenever I attempt to inject any dependency TypeError: Cannot set property 'stack' of undefined at NoProviderError.set [as stack] (errors.js:64) at assignAll (zone.js:704) at NoProviderError.ZoneAwareError (zon ...

Resetting an Angular form will clear the initially selected value

My application is built using Angular 4, and I have a select element inside my reactive form setup like this: <select class="form-control" formControlName="persons"> <option value="" selected>Select default</option> <option * ...

changing the breadcrumb item to a dropdown item in a dynamic way

Hey there, I'm currently working on creating a breadcrumb item using Angular. Here is what I have so far: https://i.stack.imgur.com/zt5yX.png I decided to add a dropdown for the breadcrumb item, but I'm facing a challenge: I want to be able to ...

Typescript throws an error indicating that the "this" object in Vue methods may be undefined, displaying error code TS2532

As a beginner in question writing, I apologize if my wording is not clear. The issue at hand: I am working on a Vue application with TypeScript. export default { methods: { setProgram: (program: Program)=>{ this.program = progra ...

Converting a file into a string using Angular and TypeScript (byte by byte)

I am looking to upload a file and send it as type $byte to the endpoint using the POST method My approach involves converting the file to base64, and then from there to byte. I couldn't find a direct way to convert it to byte, so my reasoning may be ...

Form an object using elements of a string array

Trying to convert a string array into an object. The string array is as follows : let BaseArray = ['origin/develop', 'origin/master', 'toto/branch', 'tata/hello', 'tata/world']; I want the resulting obje ...

"Troubleshooting: Why is the Angular Material MatPaginator not showing any

I'm facing an issue while trying to set up a data table in Angular 8. The paginator located below the data table seems to be malfunctioning. Despite having 10 hardcoded records in my component, changing the elements per page to 5/10 does not alter the ...

Retrieve type definitions for function parameters from an immutable array containing multiple arrays

My current challenge involves implementing a function similar to Jest's test.each iterator: // with "as const" forEach([ [ 1, 2, 3 ], [ "a", "b", "c" ], ] as const, (first, second, third) => { // ...

Disabling the scrollbar within angular elements

Trying to remove the two scrollbars from this code, but so far unsuccessful. Attempted using overflow:hidden without success filet.component.html <mat-drawer-container class="example-container" autosize> <button type="button&qu ...

Is there a way to make the vss sdk treeview collapse automatically?

Is there a way to have the nodes of a combo control of type TreeView.ComboTreeBehaviorName collapsed by default? I've searched through the documentation at this link and this link, but couldn't find a solution. I also examined the types in vss. ...