Cov txheej txheem:

Dab tsi yog lambda authorizer?
Dab tsi yog lambda authorizer?

Video: Dab tsi yog lambda authorizer?

Video: Dab tsi yog lambda authorizer?
Video: txoj kev hlub yog dab tsi by nkaujlig hawj new song 5/17/2020 2024, Kaum ib hlis
Anonim

A Lambda authorizer (yav tas los hu ua kev cai tus tso cai ) yog API Gateway feature uas siv a Lambda muaj nuj nqi los tswj kev nkag mus rau koj API. Ib tug token-based Lambda authorizer (tseem hu ua TOKEN tus tso cai ) tau txais tus neeg hu xov tooj tus kheej nyob rau hauv tus lej cim, xws li JSON Web Token (JWT) lossis OAuth token.

Xav txog qhov no, kuv yuav kuaj API gateway authorizer li cas?

Rau qhov REQUEST tus tso cai , ntaus cov ntawv thov tsis raug siv tau raws li cov ntaub ntawv qhia txog tus kheej thiab tom qab ntawd xaiv Kuaj . Ntxiv nrog rau kev siv lub API Gateway console, koj tuaj yeem siv AWS CLI or ib AWS SDK rau API Gateway rau xeem npe an tus tso cai . Yuav ua li cas siv lub AWS CLI, saib xeem -thov- tus tso cai.

API gateway yog dab tsi? Ib API rooj vag yog lub hauv paus ntawm ib qho API kev daws teeb meem. Nws ua raws li ib qho kev nkag mus rau hauv ib qho system tso cai rau ntau yam APIs los yog microservices los ua cohesively thiab muab ib tug uniform kev rau cov neeg siv. Lub luag haujlwm tseem ceeb tshaj plaws API rooj vag plays yog ua kom ntseeg tau kev ua haujlwm ntawm txhua tus API hu.

Tom qab ntawd, dab tsi yog tus tuav lub cim?

Bearer Tokens yog hom tseem ceeb ntawm kev nkag token siv nrog OAuth 2.0. A Bearer Token yog ib txoj hlua opaque, tsis yog npaj kom muaj lub ntsiab lus rau cov neeg siv nws. Qee cov servers yuav teeb tsa cov cim uas yog ib txoj hlua luv ntawm cov cim hexadecimal, thaum lwm tus tuaj yeem siv cov qauv cov cim xws li JSON Web Token.

Koj tuaj yeem tshawb xyuas Lambda ntawm Amazon li cas?

Cov kauj ruam rau kev sim Lambda muaj nuj nqi

  1. Create an AWS Lambda Java project. ?
  2. Create an AWS Lambda function. Koj yuav tsum tau siv lub Lambda muaj nuj nqi handleRequest nyob rau hauv chav kawm LambdaFunctionHandler.
  3. Unit-test the AWS Lambda function.
  4. Upload and run the AWS Lambda function.
  5. Ntsuam xyuas cov xwm txheej kev cai Lambda muaj nuj nqi.

Pom zoo: