Skip to Content
Hands-On Software Engineering with Golang
book

Hands-On Software Engineering with Golang

by Achilleas Anagnostopoulos
January 2020
Intermediate to advanced
640 pages
16h 56m
English
Packt Publishing
Content preview from Hands-On Software Engineering with Golang

Controlling access to API endpoints

After defining the endpoints for referring to resources, the next logical step is to implement a mechanism for enforcing access control. For instance, while /orders/123 and orders/789 are both valid resource paths, they might belong to different users; obviously, we would expect that each user should only be able to access their own orders.

In a different scenario, a user might be able to list the users that belong to a particular security group by performing a GET request to /security-groups/123/users, but only an administrator would be allowed to add or remove users from that group (for example, by performing POST and DELETE requests to the same endpoint). A fairly common pattern for achieving this kind ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Software Architecture with Golang

Hands-On Software Architecture with Golang

Jyotiswarup Raiturkar

Publisher Resources

ISBN: 9781838554491Supplemental Content