-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to override Collection Auth #816
Comments
Yes, i was confused by this as well. Postman called the default "inherit auth from parent" which worked well enough to get across whats happening. |
Hi. I have a WIP feature branch to implement a specific auth selection for this case: https://github.com/btgs-0/bruno/tree/feature/auth-from-collection Let me know what you think |
@btgs-0 The code looks good! I'm unable to build your fork, I believe its due to the way the electron I'm probably forgetting an install step. Application log:
|
@btgs-0 to change this from a breaking change to a feature (see https://semver.org ) I suggest adding a migration ( |
@lil5 that's a great idea, thanks. Your comment compelled me to double check export function and I've found that my branch does not export the collection auth to .bru correctly |
I've opened a draft pull request: #907 |
To keep it on version 1 the auth schema could include a const authSchema = Yup.object({
mode: Yup.string().oneOf(['none', 'awsv4', 'basic', 'bearer', 'digest']).required('mode is required'),
+ collectionOverride: Yup.boolean().nullable(),
awsv4: authAwsV4Schema.nullable(),
basic: authBasicSchema.nullable(),
bearer: authBearerSchema.nullable(),
digest: authDigestSchema.nullable()
})
that way you don't need to include any difficult migration logic. |
@lil5 will my branch cause a breaking change in the auth schema? since new auth type only applies to new requests, and I've only changed the schema to add the new auth type to it const authSchema = Yup.object({
+ mode: Yup.string().oneOf(['none', 'awsv4', 'basic', 'bearer', 'digest', 'parent']).required('mode is required'),
awsv4: authAwsV4Schema.nullable(),
basic: authBasicSchema.nullable(),
bearer: authBearerSchema.nullable(),
digest: authDigestSchema.nullable()
})
.noUnknown(true)
.strict(); |
It will break old Bruno projects (where the bru files contain auth type none) that rely on auth type none to default to the collection auth. These are hard decisions the project owner ( @helloanoop ?) should make:
I'm personally for option 4 or 3 in that order. |
Postman carries Auth at the Folder level, can we please implement this where Parent has Auth and all levels can inherit from the parent be it the folder or the collection if it is the parent. This should be supported for the Postman import as well. Can raise a new feature request if required. |
@shille |
Collection
Auth
tobearer token
Auth
tabExpected result
I expect a list starting with
Collection default - Bearer Token
(selected),AWS sigV4
,Basic Auth
,Bearer Token
,No Auth
.Result
I get this list:
AWS sigV4
,Basic Auth
,Bearer Token
,No Auth
(selected).When
No Auth
is selected, the Collection default is used. I think this is confusing.The text was updated successfully, but these errors were encountered: