Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Program security - Signer auth lesson updated #432

Conversation

0xCipherCoder
Copy link
Contributor

Problem

Summary of Changes

  • Updated code snippets with the latest anchor version
  • Fixed content,
  • Fixed grammar and styling
  • Fixed as per guidelines

Fixes #
Unboxed PRs
Starter - Unboxed-Software/solana-signer-auth#6
Solution - Unboxed-Software/solana-signer-auth#7

Copy link
Contributor

@mikemaccana mikemaccana left a comment

Choose a reason for hiding this comment

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

More excellent work with great attention to detail @0xCipherCoder. Some small changes needed but marking this as the winner assuming you do them. 🏆

- **Signer Checks** are essential to verify that specific accounts have signed a
transaction. Without proper signer checks, unauthorized accounts may execute
instructions they shouldn't be allowed to perform.
- In Rust, implement a signer check by verifying that an account's `is_signer`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- In Rust, implement a signer check by verifying that an account's `is_signer`
- In native Rust, implement a signer check by verifying that an account's `is_signer`

Copy link
Contributor

@mikemaccana mikemaccana Sep 11, 2024

Choose a reason for hiding this comment

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

Also we should probably start with Anchor, since that's the most common path.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated content to start with Anchor.

Anchor, the
[`UncheckedAccount`](https://docs.rs/anchor-lang/latest/anchor_lang/accounts/unchecked_account/struct.UncheckedAccount.html)
type indicates that no checks are performed on the account before executing the
instruction handler.
Copy link
Contributor

Choose a reason for hiding this comment

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

I appreciate the attention to detail here.


```typescript
```rust
Copy link
Contributor

Choose a reason for hiding this comment

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

lol

Comment on lines 586 to 588
source Solana program to audit. A great place to start is with the
[SPL programs](https://github.com/solana-labs/solana-program-library) if
you’re comfortable working with native Rust.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
source Solana program to audit. A great place to start is with the
[SPL programs](https://github.com/solana-labs/solana-program-library) if
you’re comfortable working with native Rust.
source Solana program to audit. A great place to start is with the
[program examples](https://github.com/solana-developers/program-examples) repo.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a better codebase as it has anchor examples (and could use an audit!).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I updated the link for the same.

@mikemaccana
Copy link
Contributor

Oh also the repo is cloned to https://github.com/solana-developers/signer-auth/ and your changes are in.

@0xCipherCoder
Copy link
Contributor Author

Oh also the repo is cloned to https://github.com/solana-developers/signer-auth/ and your changes are in.

Thanks! @mikemaccana I have updated the corresponding links for the starter and solution branch in this lesson.

@0xCipherCoder
Copy link
Contributor Author

More excellent work with great attention to detail @0xCipherCoder. Some small changes needed but marking this as the winner assuming you do them. 🏆

Thanks! @mikemaccana I have resolved the comments and updated the content accordingly. Please review and let me know if any additional changes are required.

@nickfrosty nickfrosty removed their request for review September 11, 2024 13:47
@mikemaccana mikemaccana merged commit 71dbc9a into solana-foundation:main Sep 17, 2024
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants