Skip to content
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

NOISSUE: Add Publish/Subscribe to channels #2497

Conversation

arvindh123
Copy link
Contributor

What type of PR is this?

What does this do?

Which issue(s) does this PR fix/relate to?

  • Related Issue #
  • Resolves #

Have you included tests for your changes?

Did you document any new/modified feature?

Notes

Comment on lines 56 to 62
func NewType(c uint) (Type, error) {
if err := Type(c).CheckType(); err != nil {
return Invalid, err
}
return Type(c), nil

}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove.

Comment on lines 35 to 44
func (c Type) CheckType() error {
switch c {
case Publish:
return nil
case Subscribe:
return nil
default:
return fmt.Errorf("Unknown connection type %d", c)
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's not attach this to Type, but make this an exported function CheckType(t Type) error.


var errInvalidConnType = errors.New("invalid connection type")

type Type uint8
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to ConnType.

@arvindh123 arvindh123 force-pushed the add_organization_things_channels_auth branch 2 times, most recently from 2009c3c to 9e2d276 Compare November 5, 2024 05:26
- add: publish subscribe

Signed-off-by: Arvindh <[email protected]>

add publish subscribe

Signed-off-by: Arvindh <[email protected]>

add publish subscribe

Signed-off-by: Arvindh <[email protected]>

fix: sdk import paths

Signed-off-by: Arvindh <[email protected]>

fix: domain authz

Signed-off-by: Arvindh <[email protected]>

fix: users test

Signed-off-by: Arvindh <[email protected]>

fix: coap authz

Signed-off-by: Arvindh <[email protected]>

rename: connections.Type to connections.ConnType

Signed-off-by: Arvindh <[email protected]>
@arvindh123 arvindh123 force-pushed the add_organization_things_channels_auth branch from 9e2d276 to 2378aed Compare November 5, 2024 07:16
Comment on lines 238 to 239
counter, latency := prometheus.MakeMetrics("domains", "api")
svc = dmw.MetricsMiddleware(svc, counter, latency)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add latency after auth also, we since auth middleware will affect latency.

return fmt.Errorf("Unknown connection type %d", c)
}
}
func (c ConnType) String() string {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an empty line between funcs.

}
return ConnType(c), nil

}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

return ConnType(c), nil

}
func StringToConnType(c string) (ConnType, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to ParseConnType (string -> other type = parsing and other type -> string = string/format).

Signed-off-by: Arvindh <[email protected]>
@dborovcanin dborovcanin merged commit 02e1df0 into absmach:auth-refactor Nov 5, 2024
1 of 2 checks passed
nyagamunene pushed a commit to nyagamunene/magistrala that referenced this pull request Nov 10, 2024
arvindh123 added a commit to arvindh123/magistrala that referenced this pull request Nov 12, 2024
arvindh123 added a commit to arvindh123/magistrala that referenced this pull request Nov 12, 2024
- Set/Unset parent Group for Things and Channels (absmach#2486)
- Move groups out of pkg (absmach#2493)
- Separate Things authn and Channels authz (absmach#2496)

Signed-off-by: Arvindh <[email protected]>

NOISSUE - Add Publish/Subscribe to channels (absmach#2497)

Signed-off-by: Arvindh <[email protected]>

MG-2457 - Update auth tests (absmach#2503)

Signed-off-by: Felix Gateru <[email protected]>

MG-2477 - Replace Things with Clients (absmach#2508)

Signed-off-by: Dusan Borovcanin <[email protected]>
arvindh123 added a commit to arvindh123/magistrala that referenced this pull request Nov 18, 2024
- Set/Unset parent Group for Things and Channels (absmach#2486)
- Move groups out of pkg (absmach#2493)
- Separate Things authn and Channels authz (absmach#2496)

Signed-off-by: Arvindh <[email protected]>

NOISSUE - Add Publish/Subscribe to channels (absmach#2497)

Signed-off-by: Arvindh <[email protected]>

MG-2457 - Update auth tests (absmach#2503)

Signed-off-by: Felix Gateru <[email protected]>

MG-2477 - Replace Things with Clients (absmach#2508)

Signed-off-by: Dusan Borovcanin <[email protected]>

NOISSUE - Rename Things to Clients

Signed-off-by: Felix Gateru <[email protected]>
Signed-off-by: Arvindh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants