查看: 2549|回复: 9
收起左侧

新鲜Stripe OA! 今天刚做的,求米!!!

|只看干货
匿名用户-933  2022-9-28 12:42:35 |阅读模式
本楼: 👍   100% (1)
 
 
0% (0)   👎

2023(7-9月) 码农类General 本科 实习@stripe - 网上海投 - 在线笔试  | 🙁 Negative 😣 HardFail | 其他

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x
1. Access Token



Imagine you want to design authentication and authorization for a branch new product at Stripe. You want your user to be able to send API requests to do things like refund payments or create new charges, but we want to reject someone who isn't authorized to send those requests. One possible solution is to mint a signed token embedded with the permission the "bearer" has.
This question will have multiple parts, but each section will all be passed to the same function. You can use the "key_mode" parameter to change the function behavior for each part. For example, if “key_mode” is equal to “permissions”, you should output from a different section of your solution than if the “key_mode” was “full_token”

Part 1: Permissions and Roles

Not every user can do the same things. You might have an admin who can do everything, a support specialist who should be able to see everything but can’t make new payments, or someone who has access to a specific product but can’t see data about any other products. We represent the things that a user is allowed to do as permissions.
Permissions are represented as [PRODUCT_NAME].[PERMISSIONS].For example, the payments.read_settings would allow you to read all settings for the Payment product. Capital.create_intent would allow you to create a new intent for the Capital product.
Assigning all of the necessary permissions to a user can be really cumbersome. Imagine if there are 100 permissions and you have to say that a user can do every 75 of them. To make this process simpler, we assign roles to grant a group of permissions. An “admin” role might have all of the permissions, while a “payments” role might only have the permissions relevant to the Payment product. A user can also have multiple roles which grants them access to all of the permissions implied by their roles.
   admin: The user gets all permissions
   admin_readonly: The user gets all read permissions, but not any write permissions.
Product_name. A product-specific roles; the use
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
a binary string.
There are a total of 31 permissions, so we will generate a 31- digit binary number where each digit represents one permission. The digit will be 1 if the user has permission or 0 if they do not. The digits encode the permissions in alphabetical order, so the first digit is for capital.confirm_intent and the last digit is for payments.write_settings
Your task
Given one or more roles, return the permission binary string for that user.

Example 1
Input:
   key_mode = “full_token”
   roles = capital
Output:
   0000011111000000000000000000000

评分

参与人数 8大米 +22 收起 理由
estlieaj89892 + 1 给你点个赞!
alex678 + 1 给你点个赞!
jbgsn + 1 很有用的信息!
小亩_6l9bfoj + 1 很有用的信息!
renee_y + 1 赞一个

查看全部评分


上一篇:[岛] Cisco OA 2023 | 三道题 find word in matrix, min occurrance, traverse matrix
下一篇:stack 店面
asd147 2022-10-10 05:29:38 | 显示全部楼层
本楼: 👍   100% (1)
 
 
0% (0)   👎
全局: 👍   94% (545)
 
 
5% (30)    👎
The digits encode the permissions in alphabetical order, so the first digit is for capital.confirm_intent and the last digit is for payments.write_settings
请问一下为什么按照alphabetical order排序,第一个是capital.confirm而不是banking.create?
回复

使用道具 举报

地里匿名用户
匿名用户-933  2022-10-2 06:11:45
本楼: 👍   100% (1)
 
 
0% (0)   👎
potential_mango 发表于 2022-9-30 23:43
你的下一轮是什么时候

没过OA。。。
扫码关注一亩三分地求职与职场公众号
更多干货内容等你发现
回复

使用道具 举报

potential_mango 2022-10-1 14:43:23 | 显示全部楼层
本楼: 👍   0% (0)
 
 
0% (0)   👎
全局: 👍   0% (0)
 
 
0% (0)    👎
你的下一轮是什么时候
回复

使用道具 举报

Ltysdsg 2022-10-2 15:27:49 | 显示全部楼层
本楼: 👍   0% (0)
 
 
0% (0)   👎
全局: 👍   0% (0)
 
 
0% (0)    👎
是 23intern 岗吗
回复

使用道具 举报

einepaprika 2022-10-7 16:46:37 | 显示全部楼层
本楼: 👍   0% (0)
 
 
0% (0)   👎
全局: 👍   100% (10)
 
 
0% (0)    👎
请问这是intern岗吗?
回复

使用道具 举报

本楼: 👍   0% (0)
 
 
0% (0)   👎
全局: 👍   100% (35)
 
 
0% (0)    👎
einepaprika 发表于 2022-10-07 01:46:37
请问这是intern岗吗?
嗯嗯,是Intern岗

评分

参与人数 1大米 +1 收起 理由
einepaprika + 1 很有用的信息!

查看全部评分

回复

使用道具 举报

地里匿名用户
匿名用户-0FD  2022-10-10 03:16:48
本楼: 👍   0% (0)
 
 
0% (0)   👎
你好,想问问OA要开摄像头吗?
回复

使用道具 举报

地里匿名用户
匿名用户-67F  2022-10-12 05:35:32
本楼: 👍   0% (0)
 
 
0% (0)   👎
asd147 发表于 2022-10-9 21:29
The digits encode the permissions in alphabetical order, so the first digit is for capital.confirm_i ...

但貌似举得例子captial.cinfirm是在第二个...
回复

使用道具 举报

地里匿名用户
匿名用户-521  2022-10-12 07:13:30 来自APP
本楼: 👍   0% (0)
 
 
0% (0)   👎
请问oa时间多久
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表